public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; if(strcmp(cmd, "/creditos", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Creditos do GM ^^"); SendClientMessage(playerid, COLOR_AQUA,"{D15FEE}Gamemode {FF0000}FreeFlyght V1.0."); SendClientMessage(playerid, COLOR_VERMELHO,"{FFFF00}Coder: Gabriel."); SendClientMessage(playerid, COLOR_VERMELHO,"{00FFFF}Mapper:Pigon."); return 1; } if(strcmp(cmd, "/dm1", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ! ^^"); return 1; } if(strcmp(cmd, "/dogfight", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ArenaDogFight ! ^^"); return 1; } if(strcmp(cmd, "/comandos", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Arenas DM : /dm1 /dm2 /dm3 /dm4 /dm5"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/creditos e veja quem criou o servidor ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/dogfight e va para a arena de dogfight ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/relato e fale com o admin ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve mais comandos ! ^^");
public OnPlayerCommandText(playerid, cmdtext[])
{
cmd=strtok(cmdtext,idx);
new cmd[256];
if(strcmp(cmd, "/creditos", true) == 0) {
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Creditos do GM ^^");
SendClientMessage(playerid, COLOR_AQUA,"{D15FEE}Gamemode {FF0000}FreeFlyght V1.0.");
SendClientMessage(playerid, COLOR_VERMELHO,"{FFFF00}Coder: Gabriel.");
SendClientMessage(playerid, COLOR_VERMELHO,"{00FFFF}Mapper:Pigon.");
return 1;
}
if(strcmp(cmd, "/dm1", true) == 0) {
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ! ^^");
return 1;
}
if(strcmp(cmd, "/dogfight", true) == 0) {
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ArenaDogFight ! ^^");
return 1;
}
if(strcmp(cmd, "/comandos", true) == 0) {
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Arenas DM : /dm1 /dm2 /dm3 /dm4 /dm5");
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/creditos e veja quem criou o servidor ^^");
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/dogfight e va para a arena de dogfight ^^");
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/relato e fale com o admin ^^");
SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve mais comandos ! ^^");
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
cmd=strtok(cmdtext,idx);
pawn Код:
@Edit E SE NГO TIVER: Coloque no fim do GM pawn Код:
|
C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(908) : error 017: undefined symbol "cmd" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(908) : error 017: undefined symbol "idx" C:\Users\Gabriel\Downloads\samp03dsvr_R2_win32\gamemodes\GM1.pwn(1265) : warning 219: local variable "string" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }
new cmd[20], idx;
new cmd[256],tmp[128],idx;
cmd = strtok(cmdtext,idx);
if(strcmp(cmd, "/comando", true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /comando[Id Do Jogador]");
SendClientMessage(strval(tmp),-1,"mensagem");
}
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[20], idx; cmd=strtok(cmdtext,idx); if(strcmp(cmd, "/creditos", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Creditos do GM ^^"); SendClientMessage(playerid, COLOR_AQUA,"{D15FEE}Gamemode {FF0000}FreeFlyght V1.0."); SendClientMessage(playerid, COLOR_VERMELHO,"{FFFF00}Coder: Gabriel."); SendClientMessage(playerid, COLOR_VERMELHO,"{00FFFF}Mapper:Pigon."); return 1; } if(strcmp(cmd, "/dm1", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ! ^^"); return 1; } if(strcmp(cmd, "/dogfight", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve ArenaDogFight ! ^^"); return 1; } if(strcmp(cmd, "/comandos", true) == 0) { SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Arenas DM : /dm1 /dm2 /dm3 /dm4 /dm5"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/creditos e veja quem criou o servidor ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/dogfight e va para a arena de dogfight ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}/relato e fale com o admin ^^"); SendClientMessage(playerid, COLOR_AQUA,"{FFFFFF}Em Breve mais comandos ! ^^"); return 1; }