SetVehicleNumberPlate PROBLEM.
#2

Quote:
Originally Posted by Shetch
Посмотреть сообщение
This comand doesnt seem to be working.
Just respawns the car with some wierd letter as a plate if i type in numbers. But if i type in letters it just respawns the vehicle and leaves the default plate.

My command:
Код:
dcmd_plate(playerid,params[])
{
	new Vehicle, plate[MAX_PLAYERS];
    new tmp[256], Index;
	new Float:X,Float:Y,Float:Z;
    Vehicle = GetPlayerVehicleID(playerid);
    tmp = strtok(params,Index),plate[playerid] = strval(tmp);
    if(GetPlayerScore(playerid) < 5) return SendClientMessage(playerid, GREY, "ERROR: Љo kommandu var izmantot no 5. līmeņa.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,GREY,"ERROR: Tev jāatrodas maљīnā lai izmantotu љo komandu.");
    if(IsDriver[playerid] == 0) return SendClientMessage(playerid,GREY,"ERROR: Tev jāatrodas pie stūres lai izmantotu љo komandu.");
    if(!strlen(params)) return SendClientMessage(playerid,GREY,"ERROR: /plate [Teksts]");
	SetVehicleNumberPlate(Vehicle,plate[playerid]);
    GetVehiclePos(Vehicle,Float:X,Float:Y,Float:Z);
    SetVehicleToRespawn(Vehicle);
    SetVehiclePos(Vehicle,Float:X,Float:Y,Float:Z);
    PutPlayerInVehicle(playerid,Vehicle,0);
	return 1;
}
pawn Код:
dcmd_plate(playerid,params[])
{
    new Vehicle, plate[MAX_PLAYERS];
    new tmp[256], Index;
    new Float:X,Float:Y,Float:Z;
    Vehicle = GetPlayerVehicleID(playerid);
    tmp = strtok(params,Index);
    format(plate[playerid],128,"%s",tmp);
    if(GetPlayerScore(playerid) < 5) return SendClientMessage(playerid, GREY, "ERROR: Љo kommandu var izmantot no 5. līmeņa.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,GREY,"ERROR: Tev jāatrodas maљīnā lai izmantotu љo komandu.");
    if(IsDriver[playerid] == 0) return SendClientMessage(playerid,GREY,"ERROR: Tev jāatrodas pie stūres lai izmantotu љo komandu.");
    if(!strlen(params)) return SendClientMessage(playerid,GREY,"ERROR: /plate [Teksts]");
    SetVehicleNumberPlate(Vehicle,plate[playerid]);
    GetVehiclePos(Vehicle,Float:X,Float:Y,Float:Z);
    SetVehicleToRespawn(Vehicle);
    SetVehiclePos(Vehicle,Float:X,Float:Y,Float:Z);
    PutPlayerInVehicle(playerid,Vehicle,0);
    return 1;
}
Reply


Messages In This Thread
SetVehicleNumberPlate PROBLEM. - by Shetch - 03.09.2011, 20:28
Re: SetVehicleNumberPlate PROBLEM. - by FireCat - 03.09.2011, 20:33
Re: SetVehicleNumberPlate PROBLEM. - by Vince - 03.09.2011, 20:36
Re: SetVehicleNumberPlate PROBLEM. - by Shetch - 03.09.2011, 20:37
Re: SetVehicleNumberPlate PROBLEM. - by FireCat - 03.09.2011, 20:41

Forum Jump:


Users browsing this thread: 1 Guest(s)