[POMOC]/MakeAdmin

Započeo xzeL, Januar 19, 2011, 09:54:30 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

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.....



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[256];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
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[playerid][pAdmin] >= 1337)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = 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;
}
}

black_dota

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

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

Citat: xzeL poslato Januar 19, 2011, 10:08:27 PRE PODNE
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!

Citat: Lonkec poslato Januar 19, 2011, 10:29:30 PRE PODNE
Citat: xzeL poslato Januar 19, 2011, 10:08:27 PRE PODNE
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

strtok(const string[], &index) {
new length = strlen(string),
offset = index,
result[20];
while ((index < length) && (string[index] <= ' ')) { index++; }
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) {
result[index - offset] = string[index];
index++; } result[index - offset] = EOS;
return result; }