[HELP]CameraCheck - 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: [HELP]CameraCheck (
/showthread.php?tid=78449)
[HELP]CameraCheck -
Marc_307 - 20.05.2009
Hi all, I've mad a code for a CameraCheck, but it doesn't work as I want.
![Cry](images/smilies/cry.gif)
Each Time I spawn, the's a message sended. Anybody can help me?
pawn Код:
//on top of the script
new CameraCheckTimer;
forward CameraCheck(playerid);
//under OnPlayerSpawn
CameraCheckTimer = SetTimerEx("CameraCheck",1000,1,"i",playerid);
//anywhere in the script
public CameraCheck(playerid)
{
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
if(weapons[9][0])
{
SendClientMessage(playerid,RED,"You ain't got a camera.");
KillTimer(CameraCheckTimer);
}
}
Re: [HELP]CameraCheck -
Gamer007 - 20.05.2009
Ummh. Well it will send him the message 100% because you put the timer under OnPlayerSpawn....
Re: [HELP]CameraCheck -
Marc_307 - 20.05.2009
Yes, but the message should only be sended once if a player "waste his ammo" for his camera.
Re: [HELP]CameraCheck -
Weirdosport - 20.05.2009
But when you die you lose your weapons, so when he spawns he won't have a camera...
Re: [HELP]CameraCheck -
Marc_307 - 20.05.2009
Ok, and what can I do to solve this problem? Has the timer to be on another place?