SA-MP Forums Archive
little help nedded - 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: little help nedded (/showthread.php?tid=297693)



little help nedded - Gooday - 17.11.2011

Hi, i am making my GM from 0 (im a newbie @ script but with tutorials and wiwisamp i can do something...)
Here's my class selection it won't work
Quote:

public OnPlayerRequestClass(playerid, classid)
{
AddPlayerClass(101, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(15, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(170, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(183, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(184, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(226, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(235, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(240, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(250, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(69, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(60, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(233, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(55, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(56, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(30, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
**MAP CODE HERE**
return 1;

}

and i'll make a script like:

when some1 die he have a message with "You died, your medical bill is $2000) but it won't work....
Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
SetPlayerPos(playerid, -320.2867, 1052.6426, 20.3403, 341.9651);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You died, Your medical bill is $2000");
GivePlayerMoney (playerid, -2000);
return 1;
}




Re: little help nedded - =WoR=G4M3Ov3r - 17.11.2011

PHP код:
public OnGameModeInit()
{
AddPlayerClass(1011958.37831343.157215.3746269.1425000000);
AddPlayerClass(151958.37831343.157215.3746269.1425000000);
AddPlayerClass(1701958.37831343.157215.3746269.1425000000);
AddPlayerClass(1831958.37831343.157215.3746269.1425000000);
AddPlayerClass(1841958.37831343.157215.3746269.1425000000);
AddPlayerClass(1061958.37831343.157215.3746269.1425000000);
AddPlayerClass(2261958.37831343.157215.3746269.1425000000);
AddPlayerClass(2351958.37831343.157215.3746269.1425000000);
AddPlayerClass(2401958.37831343.157215.3746269.1425000000);
AddPlayerClass(2501958.37831343.157215.3746269.1425000000);
AddPlayerClass(691958.37831343.157215.3746269.1425000000);
AddPlayerClass(601958.37831343.157215.3746269.1425000000);
AddPlayerClass(2331958.37831343.157215.3746269.1425000000);
AddPlayerClass(551958.37831343.157215.3746269.1425000000);
AddPlayerClass(561958.37831343.157215.3746269.1425000000);
AddPlayerClass(301958.37831343.157215.3746269.1425000000);
**
MAP CODE HERE**
return 
1;




Re: little help nedded - MP2 - 17.11.2011

You can't use SetPlayerPos When they're dead..
You also need to check whether killerid is valid before setting a variable for it:

pawn Код:
if(killerid != INVALID_PLAYER_ID) set var