Plz I need Help
#1

Hey Guys Today I Made This cmd to change plate name, it sucessfully compiled without any error but when i use it it wont change the plate name
pawn Код:
if(strcmp(cmd, "/setplate", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return
SendClientMessage(playerid, red,"Usage : /setplate [Plate Name]");
if(strlen(tmp))
{
SetVehicleNumberPlate(GetPlayerVehicleID(playerid), tmp);
format(string, sizeof string,"You successfully set your plate number to %s",tmp);
SendClientMessage(playerid, red, string);
}
return 1;
}
Plz I hope I Could Get Help Really Fast
Thx In Advance.
Reply
#2

Try respawning the car.
Reply
#3

Note: The vehicle must be respawned or restreamed for the changes to take effect.<< wiki
Reply
#4

Thx For Fast Reply , Im Going To Try
Reply
#5

Sry For Double Post But Plz can some1 tell me how to respawn vehicle? im still noob scripter
Reply
#6

Depends, restart server, use a command...
Relog?
Reply
#7

Get the vehicle ID and model
pawn Код:
new vehicle = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicle);
Destroy the vehicle
pawn Код:
DestroyVehicle(vehicle);
Then proceed with the vehicle plate and re-spawn
pawn Код:
SetVehicleNumberPlate(vehicle = CreateVehicle(model, x, y, z, angle, color1, color2, respawn_delay), tmp);
PutPlayerInVehicle(playerid, vehicle, 0);
Reply
#8

Nvm I FIxed The Error But Now When i put /setplate Elias
i get spawned another place plz tell me how to fix it
now the code is :
pawn Код:
if(strcmp(cmd, "/setplate", true) == 0)
            {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return
            SendClientMessage(playerid, red,"Usage : /setplate [Plate Name]");
            if(strlen(tmp))
            {
            new Float:x, Float:y, Float:z, Float:angle;
            new vehicle = GetPlayerVehicleID(playerid);
            new model = GetVehicleModel(vehicle);
            DestroyVehicle(vehicle);
            SetVehicleNumberPlate(vehicle = CreateVehicle(model, x, y, z, angle, 0, 0, 0), tmp);
            PutPlayerInVehicle(playerid, vehicle, 0);
            format(string, sizeof string,"You successfully set your plate number to %s",tmp);
            SendClientMessage(playerid, red, string);
            }
            return 1;
            }
Reply
#9

pawn Код:
GetVehiclePos(vehicle, x, y, z);
Reputation if I've helped you please, thanks.
Reply
#10

where i add GetVehiclePos? yeah ofc ill rep u if it will work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)