Help me 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: Help me please. (
/showthread.php?tid=228993)
Help me please. -
Vero - 20.02.2011
pawn Код:
if(g_fMask[playerid])
{
new string[128];
format(string, sizeof string, "Stranger: %s", text);
NearByMessage(WHITE, string);
return 0;
}
I then get this error
pawn Код:
C:\Users\Callum\Desktop\1996RP\Windows\gamemodes\1996RP.pwn(10919) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Callum\Desktop\1996RP\Windows\gamemodes\1996RP.pwn(10921) : error 035: argument type mismatch (argument 2)
Re: Help me please. -
sansko - 20.02.2011
do you have "string[128]" already anywhere else?
and btw the stringsize does not has to be that large
it will be like a hanger for a rcp lane
Re: Help me please. -
Vero - 20.02.2011
Thanks for the response but i've tried changing the sting number several times but it still ain't working.
Edit: also if it helps it used to be SendClientMessageToAll which worked fine before.
Re: Help me please. -
sansko - 20.02.2011
that string number is just a minor part
but do you has "string[128]" already in your script?
i think that is the problem
Re: Help me please. -
Vero - 20.02.2011
Yeah i do and have used it several times without an error.
Re: Help me please. -
MadeMan - 20.02.2011
pawn Код:
if(g_fMask[playerid])
{
format(string, sizeof string, "Stranger: %s", text);
NearByMessage(playerid, WHITE, string);
return 0;
}
Re: Help me please. -
Vero - 20.02.2011
pawn Код:
command(mask, playerid, params[])
{
if((g_fMask[playerid] = !g_fMask[playerid]))
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, 0);
SendClientMessage(playerid, PURPLE, "You have put on a mask." );
} else {
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(i, playerid, 1);
SendClientMessage(playerid, PURPLE, "You have taken the mask off." );
}
return 1;
}
Other bit of the script if it helps
Re: Help me please. -
Vero - 20.02.2011
Quote:
Originally Posted by MadeMan
pawn Код:
if(g_fMask[playerid]) { format(string, sizeof string, "Stranger: %s", text); NearByMessage(playerid, WHITE, string); return 0; }
|
Thanks a bunch