how to change car number plate?
#1

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?
Reply
#2

pawn Код:
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);
}
It should work, I guess, though I had never worked with this before.
Reply
#3

it will say You are not authorized to use this command. but im admin...
now it when i /changeplate it says usage: /changeplate [newplate]
Reply
#4

Quote:
Originally Posted by WardenCS
it will say You are not authorized to use this command. but im admin...
You have to be an RCON Admin
Reply
#5

now it when i /changeplate lala it says usage: /changeplate [newplate]
Reply
#6

Quote:
Originally Posted by WardenCS
now it when i /changeplate it says usage: /changeplate [newplate]
You have to specify what you want the plate to say...
Reply
#7

yea i did but still
Reply
#8

Dunno, it should work, I guess.
Reply
#9

any help?
Reply
#10

Try using it with strtok
pawn Код:
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);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)