License plate - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: License plate (
/showthread.php?tid=203926)
License plate -
Wezley - 28.12.2010
Hello im wanting to script a car dealer ship! I got alot done! the only thing is.......I dunno how to script the license plates :/ can someone plaes help im a pretty good scripter im just lost at this point thanks
Re: License plate -
blackwave - 28.12.2010
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 // top
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(plate,5,cmdtext); // Just add this line on your OnPlayerCommandText
return 0;
}
After all callbacks, add:
pawn Код:
dcmd_plate(playerid,params[])
{
new ID = GetPlayerVehicleID(playerid);
new string[128];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You're not in a vehicle");
if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /plate <number/name>");
else
{
SetVehicleNumberPlate(ID, params);
SetVehicleToRespawn(ID);
format(string,sizeof(string),"{F216FA}You've changed your{00EEFF} VehicleID: {D9FA00}%d {FAD900}plate's for: {00FF88}%s",GetVehicleModel(ID),params);
SendClientMessage(playerid, 0xFF0000FF, string);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
return 1;
}
Re: License plate -
Wezley - 28.12.2010
it says that the compialer stoped responding.........I think im missing an archive, please help