SA-MP Forums Archive
SetVehicleNumberPlate (Save Help) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetVehicleNumberPlate (Save Help) (/showthread.php?tid=203888)



SetVehicleNumberPlate (Save Help) - bsrk - 28.12.2010

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...


Re: SetVehicleNumberPlate (Save Help) - bsrk - 28.12.2010

please help...


Re: SetVehicleNumberPlate (Save Help) - Jochemd - 28.12.2010

Use DINI or Y_Ini or DUDB or WHATEVER


Re: SetVehicleNumberPlate (Save Help) - Mr.Jvxmc - 28.12.2010

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 !


Re: SetVehicleNumberPlate (Save Help) - bsrk - 28.12.2010

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


Re: SetVehicleNumberPlate (Save Help) - Jochemd - 28.12.2010

dini_Set, dini_Intset, etc.


Re: SetVehicleNumberPlate (Save Help) - bsrk - 28.12.2010

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

Help post example


Re: SetVehicleNumberPlate (Save Help) - _rAped - 28.12.2010

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;
    }