SA-MP Forums Archive
Errors - 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: Errors (/showthread.php?tid=414454)



Errors - Louris - 09.02.2013

Код:
COMMAND:priimti(playerid, params[])
{
if(PlayerInfo[playerid][pPgaujosvadas] == 1)
new giveplayerid,pName[24],gName[24],string[100]; // error here
if(sscanf(params, "d", giveplayerid))return SendClientMessage(playerid, 0xFFFFFFFF, "/priimti [ћaidėjo ID]");
else if(!IsPlayerConnected(giveplayerid))return SendClientMessage(playerid, 0xFF0000FF, "Tokio ћaidėjo nėra!");
else
{
if(PlayerInfo[giveplayerid][pGaujoi] == 1) return SendClientMessage( playerid, -1, "Ћaidėjas jau mafijoje!" );
GetPlayerName(playerid, pName,24);
GetPlayerName(giveplayerid,gName,24);
PlayerInfo[giveplayerid][pGaujoi] = true;
format(string, sizeof(string),"Priimete ћaidėją %s",gName);
SendClientMessage(playerid,0xFFFFFFAA,string);
SendClientMessage(giveplayerid,0xFFFFFFAA,"Jūs priimtas į mafiją.");
}
else
{
new giveplayerid,pName[24],gName[24],string[100];
if(sscanf(params, "d", giveplayerid))return SendClientMessage(playerid, 0xFFFFFFFF, "/priimti [ћaidėjo ID]");
else if(!IsPlayerConnected(giveplayerid))return SendClientMessage(playerid, 0xFF0000FF, "Tokio ћaidėjo nėra!");
else
{
if(PlayerInfo[giveplayerid][pGaujoi] == 1) return SendClientMessage( playerid, -1, "Ћaidėjas jau mafijoje!" );
GetPlayerName(playerid, pName,24);
GetPlayerName(giveplayerid,gName,24);
PlayerInfo[giveplayerid][pGaujoi] = 2;
format(string, sizeof(string),"Priimete ћaidėją %s",gName);
SendClientMessage(playerid,0xFFFFFFAA,string);
SendClientMessage(giveplayerid,0xFFFFFFAA,"Jūs priimtas į mafiją.");
return 1;
}
errors:

C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(2076) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(2076) : error 017: undefined symbol "giveplayerid"
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(2076) : warning 215: expression has no effect
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(2076) : error 001: expected token: ";", but found "]"
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(2076) : fatal error 107: too many error messages on one line


AW: Errors - Louris - 09.02.2013

Any ideas?


Re: Errors - RoboN1X - 09.02.2013

You missed bracket(braces) after if(...
try this,
pawn Код:
if(PlayerInfo[playerid][pPgaujosvadas] == 1)
{
    new giveplayerid,pName[24],gName[24],string[100];



Re: Errors - Zex Tan - 09.02.2013

Question, what is this command for ?

ON-Topic: Maybe it is the sscanf simplifier.


AW: Re: Errors - Louris - 09.02.2013

Quote:
Originally Posted by Zex Tan
Посмотреть сообщение
Question, what is this command for ?

ON-Topic: Maybe it is the sscanf simplifier.
To give invite player to mafia.