CMD:mo(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= 2){
if(sscanf(params, "s[158]nn",Texto,NM,NM2))
{
SendClientMessage(playerid,vermelho,"Uso: /co [cima/baixo/norte/sul/leste/oeste][distancia][velocidade]");
}
else
{
if(Texto == "cima") GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z+NM,NM2);
if(Texto == "baixo") GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z-NM,NM2);
if(Texto == "norte") GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y+NM,Z,NM2);
if(Texto == "sul") GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y-NM,Z,NM2);
if(Texto == "leste") GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X+NM,Y,Z,NM2);
if(Texto == "oeste") GetObjectPos(OBJ[playerid],X,Y,Z); MoveObject(OBJ[playerid],X-NM,Y,Z,NM2);
}
} else SendClientMessage(playerid,vermelho,"ERRO: Nгo Autorizado!");
return 1;
}
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(981) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(982) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(983) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(984) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(985) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(986) : error 033: array must be indexed (variable "-unknown-")
D:\Usuarios\Desktop\WD\server\gamemodes\WD.pwn(2225) : warning 203: symbol is never used: "PIP"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
CMD:mo(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= 2)
{
if(sscanf(params, "s[158]nn",Texto,NM,NM2))
return SendClientMessage(playerid,vermelho,"Uso: /co [cima/baixo/norte/sul/leste/oeste][distancia][velocidade]");
else
{
if(!strcmp(Texto,"cima",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z+NM,NM2);
else if(!strcmp(Texto,"baixo",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z-NM,NM2);
else if(!strcmp(Texto,"norte",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y+NM,Z,NM2);
else if(!strcmp(Texto,"sul",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y-NM,Z,NM2);
else if(!strcmp(Texto,"leste",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X+NM,Y,Z,NM2);
else if(!strcmp(Texto,"oeste",true))GetObjectPos(OBJ[playerid],X,Y,Z); MoveObject(OBJ[playerid],X-NM,Y,Z,NM2);
}
}
else SendClientMessage(playerid,vermelho,"ERRO: Nгo Autorizado!");
return 1;
}
em string vc nao usa ==, vc usa !strcmp
pawn Код:
|
if(!strcmp(Texto,"cima",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z+NM,NM2);
else if(!strcmp(Texto,"baixo",true)) GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z-NM,NM2);
new OBJ[MAXPLAYERS] = 1;
CMD:mo(playerid, params[])
{
if(Level[playerid] >= 2)
{
new Texto[6],NM,NM2;
if(sscanf(params, "sff",Texto,NM,NM2))
return SendClientMessage(playerid,COLOR_RED,"Uso: /co [cima/baixo/norte/sul/leste/oeste][distancia][velocidade]");
else
{
new Float:X, Float:Y, Float:Z;
if(!strcmp(Texto,"cima",true)){ GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z+NM,NM2);}
else if(!strcmp(Texto,"baixo",true)) {GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y,Z-NM,NM2);}
else if(!strcmp(Texto,"norte",true)) {GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y+NM,Z,NM2); }
else if(!strcmp(Texto,"sul",true)) {GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X,Y-NM,Z,NM2);}
else if(!strcmp(Texto,"leste",true)) {GetObjectPos(OBJ[playerid],X,Y,Z);MoveObject(OBJ[playerid],X+NM,Y,Z,NM2);}
else if(!strcmp(Texto,"oeste",true)){GetObjectPos(OBJ[playerid],X,Y,Z); MoveObject(OBJ[playerid],X-NM,Y,Z,NM2);}
}
}
else SendClientMessage(playerid,COLOR_RED,"ERRO: Nгo Autorizado!");
return 1;
}