SetVehicleNumberPlate PROBLEM.
#1

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;
}
Reply
#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
#3

What the hell is this supposed to be doing?
pawn Код:
tmp = strtok(params,Index),plate[playerid] = strval(tmp);
This is dcmd, not some lousy strcmp.
Reply
#4

Thanks, +reputation.


Quote:
Originally Posted by Vince
Посмотреть сообщение
What the hell is this supposed to be doing?
pawn Код:
tmp = strtok(params,Index),plate[playerid] = strval(tmp);
This is dcmd, not some lousy strcmp.
i dont need that?
Reply
#5

Oh lol it's dcmd.
pawn Код:
dcmd_plate(playerid,params[])
{
    new Vehicle, plate[MAX_PLAYERS];
    new Float:X,Float:Y,Float:Z;
    Vehicle = GetPlayerVehicleID(playerid);
    format(plate[playerid],128,"%s",params);
    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;
}
Rep?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)