14.07.2010, 04:37
how would i make a command telling you the car id like
/carid
sendclient message your car id is %
how would this be done?
/carid
sendclient message your car id is %
how would this be done?
if(strcmp(cmd, "/carid", true) == 0) {
if(!IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, red, "You need to be in a car to use this command.");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
new string[128];
format(string, sizeof(string), "Your car id is %d", vehicleid);
SendClientMessage(playerid, yellow, string);
return 1;
}
C:\Users\Robert\Desktop\SA-MP\gamemodes\crp.pwn(9019) : warning 219: local variable "string" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 6304 bytes Code size: 561580 bytes Data size: 1372116 bytes Stack/heap size: 16384 bytes; estimated max. usage=4086 cells (16344 bytes) Total requirements: 1956384 bytes 1 Warning.
new string[128];
if(strcmp(cmd, "/carid", true) == 0) {
if(!IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, red, "You need to be in a car to use this command.");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
format(string, sizeof(string), "Your car id is %d", vehicleid);
SendClientMessage(playerid, yellow, string);
return 1;
}