07.02.2013, 20:56
How can I make a variable that sets the result of tmp (or what the player enters after the command)?
I want "tmp" / what the player enters after the command, to be the variable "VehID". See bellow code for what I need help with.
I want "tmp" / what the player enters after the command, to be the variable "VehID". See bellow code for what I need help with.
pawn Код:
if (strcmp(cmd, "/breaklock", true) == 0)
{
if(PlayerInfo[playerid][pJob] == 5)// Job 5 is Car Jacker Job
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /breaklock [Vehicle ID]");
return 1;
}
new VehID = tmp;// This doesn't work :(
new Float:X, Float:Y, Float:Z;
GetVehiclePos(VehID, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 20.0, X, Y, Z))
{
if(IsAnOwnableCar(VehID))
{
if (CarInfo[VehID][cLock] == 1)
{
CarInfo[VehID][cLock] = 0;
PutPlayerInVehicle(playerid, VehID, 0);
format(string, sizeof(string), "Vehicle ID Entered: %s", VehID);
SendClientMessage(playerid,COLOR_GRAD2,string);
}
}
}