Simple help please - 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: Simple help please (
/showthread.php?tid=273596)
Simple help please -
Davz*|*Criss - 02.08.2011
hey guys this is the function i am creating it.
pawn Код:
if(PlayerInfo[playerid][pAdminstrator] = 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!") && PlayerInfo[playerid][pAdminstrator] = 1;
and i got these errors:
C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : warning 211: possibly unintended assignment
C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : error 022: must be lvalue (non-constant)
C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
620 error line is that one only.
Re: Simple help please -
Toreno - 02.08.2011
Try this.
pawn Код:
if(PlayerInfo[playerid][pAdminstrator] = 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!");
Re: Simple help please -
Basicz - 02.08.2011
No idea what are you doing with that
pawn Код:
if(PlayerInfo[playerid][pAdminstrator] == 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!");
You are setting the pAdminstrator to 1 after checking it. And the = must be two.
Re: Simple help please -
Rolyy - 02.08.2011
This should do it.
Код:
if(PlayerInfo[playerid][pAdminLevel] == 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!"); PlayerInfo[playerid][pAdminLevel] = 1;
Just take a close look to both codes and what you've done wrong.
Код:
if(PlayerInfo[playerid][pAdminstrator] == 1) //"=" Operator is INCORRECT, Must be "==".
//= Operator is to SET the value //== Operator is to CHECK if the value is true.
return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!"); //";" Token is missing.
&& //this must be removed.
PlayerInfo[playerid][pAdminstrator] = 1;
An more detailed link:
https://sampwiki.blast.hk/wiki/Control_Structures#Operators
[EDIT:
Too late >_<.]
Re: Simple help please -
Davz*|*Criss - 02.08.2011
Thanks