[SOLVED]Help[SOLVED] - 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: [SOLVED]Help[SOLVED] (
/showthread.php?tid=135100)
[SOLVED]Help[SOLVED] -
[WF]Demon - 19.03.2010
hi im trying to make it so that in OnPlayerUpdate it checks if the players z pos is 0 i get this
pawn Код:
C:\Users\Windows Vista\sampR4\gamemodes\Sumo.pwn(346) : error 036: empty statement
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
this the code i got
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid, x, y, z);
if(z == 0);
new iRandom = random(sizeof(SumoRandCars));
new iRandColors = random(sizeof(SumoRandColors));
new VehID[256];
VehID[playerid] = CreateVehicle(SumoRandCars[iRandom][0], 4117.751953125,-1185.1917724609,22,270.27026367188,SumoRandColors[iRandColors][0],SumoRandColors[iRandColors][0], 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
PutPlayerInVehicle(playerid, VehID[playerid], 0);
SendClientMessageToAll(GREEN, "[Respawn] Has Been Respawned![Reason: Fell Off]");
return 1;
}
the line 346 is
Thanks, Cody Beer
Re: Help -
cessil - 19.03.2010
Well you're saying "if z is equal to 0"
Then nothing else, I think you mean to open some brackets
Re: Help -
[WF]Demon - 19.03.2010
changed it to
got
pawn Код:
C:\Users\Windows Vista\sampR4\gamemodes\Sumo.pwn(351) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
line 351 is }
Re: Help -
sushihusi - 19.03.2010
You need this
and before "return 0;" you need a "}"
sorry but i wrote this on PSP
Re: Help -
sushihusi - 19.03.2010
before return1;* sorry
Re: Help -
Rzzr - 19.03.2010
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid, x, y, z);
if(z == 0)
{
new iRandom = random(sizeof(SumoRandCars));
new iRandColors = random(sizeof(SumoRandColors));
new VehID[256];
VehID[playerid] = CreateVehicle(SumoRandCars[iRandom][0], 4117.751953125,-1185.1917724609,22,270.27026367188,SumoRandColors[iRandColors][0],SumoRandColors[iRandColors][0], 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
PutPlayerInVehicle(playerid, VehID[playerid], 0);
SendClientMessageToAll(GREEN, "[Respawn] Has Been Respawned![Reason: Fell Off]");
}
return 1;
}
2 things:
1. Why are you making the respawn delay so long, use -1 and it won't respawn.
2. Your code is very inefficient, especially in OnPlayerUpdate this is some bad code....
Re: Help -
[WF]Demon - 19.03.2010
(1)Thanks for the tip
(2)i know its shitty look in my sig and look at that pic where it says PAWN
(3)thanks sushihusi
[SOLVED]