SetVehicleNumberPlate (Save Help)
#1

if(strcmp(cmd, "/plate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new ID = GetPlayerVehicleID(playerid);
new cmodel = GetVehicleModel(ID);
cmodel -= 400;
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GRAD2, "* ERROR");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /plate [number/name]");
return 1;
}
else
{
SetVehicleNumberPlate(ID, tmp);
SetVehicleToRespawn(ID);
format(string,sizeof(string),"* carname: %d number/name: %s",PlayerVehicle[cmodel],tmp);
SendClientMessage(playerid, 0x00FFFFFF, string);
}
}
}
return 1;
}

Help please...
Reply
#2

please help...
Reply
#3

Use DINI or Y_Ini or DUDB or WHATEVER
Reply
#4

Quote:
Originally Posted by bsrk
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/plate", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new ID = GetPlayerVehicleID(playerid);
            new cmodel = GetVehicleModel(ID);
            cmodel -= 400;
            if(!IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "* ERROR");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /plate [number/name]");
                    return 1;
                }
                else
                {
                    SetVehicleNumberPlate(ID, tmp);
                    SetVehicleToRespawn(ID);
                    format(string,sizeof(string),"* carname: %d number/name: %s",PlayerVehicle[cmodel],tmp);
                    SendClientMessage(playerid, 0x00FFFFFF, string);
                }
            }
        }
        return 1;
    }
Help please...
Show errors !
Reply
#5

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Use DINI or Y_Ini or DUDB or WHATEVER
How do DINI or Y_Ini or DUDB ?
Reply
#6

dini_Set, dini_Intset, etc.
Reply
#7

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
dini_Set, dini_Intset, etc.
Do you have examples?

Help post example
Reply
#8

The command should work. What do you want to do? Save it to a file so it will automaticly respawn with that plate number?
pawn Код:
// plate
    if(strcmp(cmd, "/plate", true) == 0)
    {
        if(!IsPlayerConnected(playerid)){return 0;}
        if(PlayerInfo[playerid][pAdmin] < 1){return 0;}

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /plate [number/name]");
            return 1;
        }
        else if(strlen(tmp) > 32)
        {
            SendClientMessage(playerid, COLOR_GRAD1, "ERROR: Plate text can't be longer then 32 characters (including colors).");
            return 1;
        }
        else
        {
            new Float:vx, Float:vy, Float:vz;
            new tempveh = GetPlayerVehicleID(playerid);
            GetVehiclePos(tempveh, vx, vy, vz);
            SetVehicleNumberPlate(tempveh, tmp);
            SetVehicleToRespawn(tempveh);
            SetVehiclePos(tempveh, vx, vy, vz);
            PutPlayerInVehicle(playerid, tempveh, 0);
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)