09.07.2009, 08:15
public OnPlayerCommandText(playerid, cmdtext[])
{
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if(strcmp(cmdtext, "/givenrg", true) == 0)
LINE 107 new string[256], tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /give nrg [id]");
giveplayerid = strval(tmp);
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s(%i) Has get the NRG-500 by the admin!", sendername, playerid);
SendClientMessageToAll(giveplayerid, COLOR_RED, string);
new Float
cx, Float
cy, Float
cz;
GetPlayerePos(giveplayerid,scx, scy, scz);
SetVehiclePos(522,scx+1,scy+1,scz+1);
format(string, sizeof(string), "You have gave NRG-500 to a player%s(%i)", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
GivePlayerMoney( playerid, 10000 );
}
else
{
format(string, sizeof(string), "SERVER: %d isn't connected", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
return 0;
}
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 003: declaration of a local variable must appear in a compound block
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : warning 217: loose indentation
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 017: undefined symbol "string"
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : warning 215: expression has no effect
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 001: expected token: ";", but found "]"
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : fatal error 107: too many error messages on one line
{
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
if(strcmp(cmdtext, "/givenrg", true) == 0)
LINE 107 new string[256], tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /give nrg [id]");
giveplayerid = strval(tmp);
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s(%i) Has get the NRG-500 by the admin!", sendername, playerid);
SendClientMessageToAll(giveplayerid, COLOR_RED, string);
new Float
![confused](images/smilies/confused.gif)
![confused](images/smilies/confused.gif)
![confused](images/smilies/confused.gif)
GetPlayerePos(giveplayerid,scx, scy, scz);
SetVehiclePos(522,scx+1,scy+1,scz+1);
format(string, sizeof(string), "You have gave NRG-500 to a player%s(%i)", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
GivePlayerMoney( playerid, 10000 );
}
else
{
format(string, sizeof(string), "SERVER: %d isn't connected", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
return 0;
}
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 003: declaration of a local variable must appear in a compound block
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : warning 217: loose indentation
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 017: undefined symbol "string"
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : warning 215: expression has no effect
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : error 001: expected token: ";", but found "]"
D:\New Folder\GTA San Andreas\SAMP\SAMP SERVER\filterscripts\Givenrg.pwn(107) : fatal error 107: too many error messages on one line