22.04.2009, 12:35
can someone make me command like that? or tell me how,i would like like that /changeplate (carid) it will be for admins only..please?
if(!strcmp(cmd,"/changeplate",true))
{
new string[64];
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,0xFFFFFFAA,"You are not authorized to use this command.");
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
if(cmdtext[idx++] != 32 || cmdtext[idx] == EOS)
return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /changeplate [newplate]");
format(string,sizeof(string),"%s",cmdtext[idx]);
return SetVehicleNumberPlate(GetPlayerVehicleID(playerid),string);
}
Originally Posted by WardenCS
it will say You are not authorized to use this command. but im admin...
|
Originally Posted by WardenCS
now it when i /changeplate it says usage: /changeplate [newplate]
|
if(!strcmp(cmd,"/changeplate",true))
{
new idx;
new plate[8];
plate = strtok(cmdtext,idx);
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,0xFFFFFFAA,"You are not authorized to use this command.");
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle.");
if(!strlen(plate))
return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /changeplate [newplate]");
return SetVehicleNumberPlate(GetPlayerVehicleID(playerid),plate);
}