[SOLVED]Help[SOLVED]
#1

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
pawn Код:
if(z == 0);
Thanks, Cody Beer
Reply
#2

Well you're saying "if z is equal to 0"
Then nothing else, I think you mean to open some brackets
Reply
#3

changed it to
pawn Код:
if(z == 0)
    }
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 }
Reply
#4

You need this
Код:
if(z == 0)
{
and before "return 0;" you need a "}"
sorry but i wrote this on PSP
Reply
#5

before return1;* sorry
Reply
#6

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

(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]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)