05.07.2011, 15:55
Boas, eu queria um comando, simples que era o /arranjarveiculo e so se podia usar 1 vez....
Se usar-se duas vezes jб nгo deixava
Se usar-se duas vezes jб nгo deixava
if(!strcmp(cmd, "/arranjarveiculo", true))
{
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Use: /arranjarveiculo MODELO"); new Modelo = strval(tmp);
if(GetPVarInt(playerid, "UsouCMD") == 1) return SendClientMessage(playerid, -1, "<!> Vocк jб usou 1x o cmd.");
SetPVarInt(playerid, "UsouCMD", 1); //usou o cmd
SetTimerEx("j_Unblock",SEGUNDOS,false,"i", playerid); //timer
new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
CreateVehicle(Modelo, Pos[0],Pos[1],Pos[2],Pos[3], -1, -1, 10000);
//Resto do comando
return true;
}
forward j_Unblock(playerid); public j_Unblock(playerid) return SetPVarInt(playerid, "UsouCMD", 0);
new v[MAX_PLAYERS];
// NO COMANDO
if(!strcmp(cmdtext,"/av", true,3))
{
if(v[playerid] != 0 ) return SendClientMessage(playerid, -1,"[INFO]? vocк jб arranjou um veiculo");
if(!strval([cmdtext[5])) return SendClientMessage(playerid, -1,"[INFO] Correto: /av MODELO");
static
Float
:Xiz,
Float
:Ypslo,
Float
:Zez,
Float
:Angulo;
GetPlayerPos(playerid, Float:Xiz, Float:Ypslo, Float:Zez);
GetPlayerFacingAngle(playerid, Float:Angulo);
CreateVehicle(strval([cmdtext[5]), Float:Xiz,Float:Ypslo,Zez,Float:Angulo, -1, -1, 10000)
return 1;
}
v[playerid] = 0;
new bool:cmd_arranjarveiculoliberado[MAX_PLAYERS];
if (strcmp(cmd,"/arranjarveiculo",true) == 0)
{
new veiculo,cor1,cor2,Float:Pos[3];
if(cmd_arranjarveiculoliberado[playerid] == true)
return SendClientMessage(playerid,-1,"[INFO] Vocк ja usou este comando e nгo pode usar denovo");
tmp = strtok(cmdtext,idx);
veiculo = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Digite: /arranjarveiculo [ID do Veiculo] [COR 1] [COR 2]");
if(veiculo < 400 || veiculo > 600) return SendClientMessage(playerid,-1,"[INFO] Veiculo Invalido");
tmp = strtok(cmdtext,idx);
cor1 = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Digite: /arranjarveiculo [ID do Veiculo] [COR 1] [COR 2]");
tmp = strtok(cmdtext,idx);
cor2 = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Digite: /arranjarveiculo [ID do Veiculo] [COR 1] [COR 2]");
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
new veh = CreateVehicle(veiculo,Pos[0],Pos[1],Pos[2],0,cor1,cor2,9999);
PutPlayerInVehicle(playerid,veh,0);
cmd_arranjarveiculoliberado[playerid] = true;
return true;
}
new bool:blockcmd[MAX_PLAYERS];
if (strcmp(cmd,"/arranjarveicuclo",true) == 0)
{
if(blockcmd[playerid] == true) return SendClientMessage(playerid,-1,"Vocк ja arranjou o veiculo 1 vez");
new MyVehicle = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo esta dentro de um veiculo");
SendClientMessage(playerid,-1,"[INFO] O Seu veiculo foi 'arranjado'");
blockcmd[playerid] = true;
RepairVehicle(MyVehicle);
return true;
}
C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1402) : error 017: undefined symbol "cmd" C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1404) : error 017: undefined symbol "blockcmd" C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1404) : warning 215: expression has no effect C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1404) : error 001: expected token: ";", but found "]" C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1404) : error 029: invalid expression, assumed zero C:\Users\Pedro\Desktop\server\Z_SUMO v1.1.6\gamemodes\ZSumoServer_v1.1.6.pwn(1404) : fatal error 107: too many error messages on one line |