What's wrong again? - 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: What's wrong again? (
/showthread.php?tid=426459)
What's wrong again? -
LeeXian99 - 29.03.2013
pawn Код:
CMD:partyhouse(playerid,params[])
{
if(g_antifall[playerid] = 0)
{
SetPlayerPos(playerid,-827.6990,-1901.7521,11.8223);
SendClientMessage(playerid, 0x00FF00, "Welcome to Party House.");
new name[MAX_PLAYER_NAME+1], string[128];
GetPlayerName(playerid, name, sizeof(name));
format (string, sizeof(string), "[TP]: %s has teleported to /partyhouse.", name);
SendClientMessageToAll(green, string);
return 1;
}
else return SendClientMessage(playerid, red, "You must exit your vehicle to teleport!");
}
Errors: (there's more, just taking an example)
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5229) : warning 211: possibly unintended assignment
Re: What's wrong again? -
Da_Noob - 29.03.2013
Use == in your if-statement instead of=
Re: What's wrong again? -
CoaPsyFactor - 29.03.2013
if(g_antifall[playerid] = 0) it should be if(g_antifall[playerid] == 0)
Re: What's wrong again? -
Gamer_007 - 29.03.2013
Quote:
Originally Posted by LeeXian99
pawn Код:
CMD:partyhouse(playerid,params[]) { if(g_antifall[playerid] = 0) { SetPlayerPos(playerid,-827.6990,-1901.7521,11.8223); SendClientMessage(playerid, 0x00FF00, "Welcome to Party House."); new name[MAX_PLAYER_NAME+1], string[128]; GetPlayerName(playerid, name, sizeof(name)); format (string, sizeof(string), "[TP]: %s has teleported to /partyhouse.", name); SendClientMessageToAll(green, string); return 1; } else return SendClientMessage(playerid, red, "You must exit your vehicle to teleport!"); }
Errors: (there's more, just taking an example)
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5229) : warning 211: possibly unintended assignment
|
'=' is used for assigning the values and '==' is used for checking conditions.