Number Plate Changing Command Help Needed!!
#1

So I'm in the process of converting all my commands to zcmd, and I decided to mess around with a number plate changer command to get away from all the copy and pasting. I believe i have all the floats in the right spots but my problem is getting it so it will set the numberplate text to what the player specified. Here's the code I have so far:
Код:
COMMAND:numplate(playerid,params[])
{
	new numplate;
	(!sscanf(params, "ui", numplate));
	new Float:x, Float:y, Float:z, Float:zr;
	new vh;
	vh = GetPlayerVehicleID(playerid);
	SetVehicleNumberPlate(vh, numplate);
	GetVehiclePos(vh, x, y, z);
	GetVehicleZAngle(vh, zr);
	SetVehicleToRespawn(vh);
	SetVehiclePos(vh, x, y, z);
	SetVehicleZAngle(vh, zr);
	return 1;
}
Reply
#2

pawn Код:
CMD:numplate(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /NumPlate < Plate >");

    new
        vID = GetPlayerVehicleID(playerid),
        Float:Pos[4],
        gStr[70];
                   
    GetVehiclePos(vID, Pos[0], Pos[1], Pos[2]);
    GetVehicleZAngle(vID, Pos[3]);

    SetVehicleNumberPlate(vID, params);
    SetVehicleToRespawn(vID);
    PutPlayerInVehicle(playerid, vID, 0);

    SetVehiclePos(vID, Pos[0], Pos[1], Pos[2]);
    SetVehicleZAngle(vID, Pos[3]);

    format(gStr, sizeof(gStr), "You've set your plate to: %s", params);
    SendClientMessage(playerid, -1, gStr);
    return 1;
}
Reply
#3

Thanks I'll try that out,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)