[FilterScript] Numplate changer
#1

Have a nice day!


As you can see the name of the subject, it's a numplate changing.
To use this command, you must be a vehicle.
Command: /numplate [new numplate]
Code:

pawn Код:
#include "a_samp"
#include "zcmd"

public OnFilterScriptInit() return 1;

public OnFilterScriptExit() return 1;

CMD:nump(playerid, params[]) return cmd_numplate(playerid, params);
CMD:numplate(playerid, params[]) {
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "A driver needs the command for his usage to be!");
    if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /numplate [new numplate]");
    if(!(2 < strlen(params) < 19)) return SendClientMessage(playerid, 0xFF0000AA, "Character one needs at least 3, at most 18 for the registration number to be.");
    new vehicleid = GetPlayerVehicleID(playerid);

    new Float:p[4];
    GetVehiclePos(vehicleid, p[0], p[1], p[2]);
    GetVehicleZAngle(vehicleid, p[3]);

    SetVehicleNumberPlate(vehicleid, params);
    SetVehicleToRespawn(vehicleid);

    SetVehiclePos(vehicleid, p[0], p[1], p[2]);
    SetVehicleZAngle(vehicleid, p[3]);

    PutPlayerInVehicle(playerid, vehicleid, 0);

    new string[144];
    format(string, 144, "You rewrote the registration number of your vehicle successfully: '%s'", params);
    SendClientMessage(playerid, 0x33AA33FF, string);
    return 1;
}
Reply
#2

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)