Započeo xzeL
•19. Jan. 2011.[POMOC]/MakeAdmin
1,154
pregleda
6
postova
Street Runner
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
22
Postovi:
9
Teme:
Pridružio se:Jan. 2011
19. Jan. 2011.
Ovako radim MOD od 0...i sada sam ubaci admin sistem sve i sada su dosle komande na red...uzeo sam admin sistem iz GF moda i onplayercommand..samo za makeadmin komandu....i evo koje mi errore izbacuje.....
evo i onplayercommand....
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(244) : error 017: undefined symbol "strtok"
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(244) : error 033: array must be indexed (variable "cmd")
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(249) : error 017: undefined symbol "strtok"
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(249) : error 033: array must be indexed (variable "tmp")
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(258) : error 017: undefined symbol "strtok"
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(258) : error 033: array must be indexed (variable "tmp")
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(243) : warning 203: symbol is never used: "idx"
C:\Users\NodY\Desktop\Virtuality\gamemodes\virtuality.pwn(243 -- 284) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.evo i onplayercommand....
public OnPlayerCommandText(playerid, cmdtext[])
{
new string;
new sendername;
new giveplayer;
new cmd;
new tmp;
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/makeadmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo >= 1337)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo = level;
printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
}19. Jan. 2011.
jao lika
pa nemozes ubaciti komandu iz gf u mod od nula
ovo za strtok i cmd moras naci u onplayercommandtext a strtok ces isto naci samo kopiras u mod
pa nemozes ubaciti komandu iz gf u mod od nula
ovo za strtok i cmd moras naci u onplayercommandtext a strtok ces isto naci samo kopiras u mod
Shot Caller
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
192
Postovi:
49
Teme:
Pridružio se:Sep. 2009
19. Jan. 2011.
xzeL wrote on January 19, 2011, 9:08 am:
Samo admin sistem je iz GFa...a sa strotk..sam cijeli gf mod prevrno nema ništa mozes li mi dat kod koji da ubacim za strtok i da riješim više ovaj problem :S
Trazio si strotk! A trebas strtok!
Street Runner
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
22
Postovi:
9
Teme:
Pridružio se:Jan. 2011
19. Jan. 2011.
Lonkec wrote on January 19, 2011, 9:08 am:
Samo admin sistem je iz GFa...a sa strotk..sam cijeli gf mod prevrno nema ništa mozes li mi dat kod koji da ubacim za strtok i da riješim više ovaj problem :S
Trazio si strotk! A trebas strtok!
Ne kontam te
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,126
Postovi:
91
Teme:
Pridružio se:Jul 2010
19. Jan. 2011.
strtok(const string[], &index) {
new length = strlen(string),
offset = index,
result;
while ((index < length) && (string <= ' ')) { index++; }
while ((index < length) && (string > ' ') && ((index - offset) < (sizeof(result) - 1))) {
result[index - offset] = string;
index++; } result[index - offset] = EOS;
return result; }
new length = strlen(string),
offset = index,
result;
while ((index < length) && (string <= ' ')) { index++; }
while ((index < length) && (string > ' ') && ((index - offset) < (sizeof(result) - 1))) {
result[index - offset] = string;
index++; } result[index - offset] = EOS;
return result; }
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava