How can mix these scripts? - 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)
+--- Thread: How can mix these scripts? (
/showthread.php?tid=574715)
How can mix these scripts? -
Steveproxy5 - 19.05.2015
Hi, how can I use this file
http://pastebin.com/9EKAF2ZF for example:
Player chooses CASE A and he'll do test trip, then when he has finished this one
Код:
if(GetPlayerVehicleID(playerid)==PlayerInfo[playerid][pdrivetestcar] && PlayerInfo[playerid][pondrivetest]!=-1)
{
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pdrivetestchk]++;
if(PlayerInfo[playerid][pdrivetestchk]==11)//penultimo
{
SetPlayerRaceCheckpoint(playerid,1,drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][0][0],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][0][1],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][0][2],0.0,0.0,0.0,3);
}
else if(PlayerInfo[playerid][pdrivetestchk]==12)//ultimo
{
new Float:vh;
GetVehicleHealth(PlayerInfo[playerid][pdrivetestcar],vh);
if(vh<950) SendClientMessage(playerid,COLOR_NO,"Il veicolo и danneggiato! Sei stato bocciato");
else
{
SendClientMessage(playerid,COLOR_INFO,"Complimenti! Hai superato il test, ora hai la tua patente con 20 punti");
PlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pondrivetest]]=20;
SavePlayer(playerid);
}
PlayerInfo[playerid][pondrivetest]=-1;
VehicleInfo[PlayerInfo[playerid][pdrivetestcar]][visvalid]=0;
UnLockVehicle(PlayerInfo[playerid][pdrivetestcar]);
DestroyVehicle(PlayerInfo[playerid][pdrivetestcar]);
SetPlayerPos(playerid,-90.9501,1118.4391,20.7860);
}
else
{
new chktype;
switch(PlayerInfo[playerid][pondrivetest])
{
case DRIVE_LICENSE_A, DRIVE_LICENSE_B, DRIVE_LICENSE_C, DRIVE_LICENSE_D, DRIVE_LICENSE_BOAT: chktype=0;
case DRIVE_LICENSE_FLY_HELI, DRIVE_LICENSE_FLY_PLANE: chktype=3;
default: chktype=0;
}
SetPlayerRaceCheckpoint(playerid,chktype,drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]][0],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]][1],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]][2],
drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]+1][0],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]+1][1],drivetestcheckpoint[PlayerInfo[playerid][pondrivetest]][PlayerInfo[playerid][pdrivetestchk]+1][2],3);
}
}
For example he selects CASE A, this one corresponds to License A and when he finishes driving trip he'll get pLicenzaA in place of PlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pondrivetest]]=20;
SavePlayer(playerid);
PlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pondrivetest]]=20;
SavePlayer(playerid); -> PlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pLicenzaA]]=20;
SavePlayer(playerid);
Re: How can mix these scripts? -
icra - 20.05.2015
Can't understand what you want to do.
I see your code is writen in Italian, if you are explain yourself using italian, i'll understand better as i am italian too.
Re: How can mix these scripts? -
Steveproxy5 - 20.05.2015
I want to set PlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pLicenzaA]]=20; if a player selects CASE A etc... In place ofPlayerInfo[playerid][pdrivelicense][PlayerInfo[playerid][pondrivetest]]=20;