24.04.2011, 16:10
I am not sure if this is correct but my command now looks like this.
and I get the following errors.
Line 3204.
Also on this bit here.
on ResetPlayerWeapons and GivePlayerWeapons, it does that to the person typing the command, not the the person who is getting punished.
Thanks.
Edit: In this script I don't have OnPlayerRequestClass, I only have that in the gamemode, this is just a filterscript.
pawn Код:
dcmd_housepun(playerid,params[])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOR_LIGHTRED,"ERROR: You are not a high enough level to use this command");
if(!strlen(params)) return SendClientMessage(playerid, COLOR_PINK, "USAGE: /housepun [playerid]");
new player1 = strval(params), string[128], pName[24];
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, pName, 24);
format(string, sizeof(string), "You have punished \"%s\" ", pName);
SendClientMessage(playerid,COLOR_PINK,string);
if(player1 != playerid)
{
format(string,sizeof(string),"Administrator \"%s\" has punished you", pName);
SendClientMessage(player1,COLOR_PINK,string);
}
SetPlayerPos(player1, 694.7562,-2377.2427,-0.0825);
SetPVarInt(player1, "housepun", 1); // Set a pvar
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 14, 0);
}
InHousePun[player1] = 1;
if(InHousePun[player1] == 1)
{
PlayerInfo[playerid][Level] == 0 // player1's admin level will be set to 0
SendClientMessage(player1,COLOR_PINK,"You Have Been Demoted To Level 0.");
}
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID ) return SendClientMessage(playerid,COLOR_LIGHTRED,"ERROR: Player is not connected");
return 1;
}
Код:
C:\Users\J\Desktop\sa-mp files\filterscripts\SA.pwn(3204) : error 017: undefined symbol "PlayerInfo" C:\Users\J\Desktop\sa-mp files\filterscripts\SA.pwn(3204) : warning 215: expression has no effect C:\Users\J\Desktop\sa-mp files\filterscripts\SA.pwn(3204) : error 001: expected token: ";", but found "]" C:\Users\J\Desktop\sa-mp files\filterscripts\SA.pwn(3204) : error 029: invalid expression, assumed zero C:\Users\J\Desktop\sa-mp files\filterscripts\SA.pwn(3204) : fatal error 107: too many error messages on one line
pawn Код:
PlayerInfo[playerid][Level] == 0 // player1's admin level will be set to 0
pawn Код:
SetPlayerPos(player1, 694.7562,-2377.2427,-0.0825);
SetPVarInt(player1, "housepun", 1); // Set a pvar
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 14, 0);
Thanks.
Edit: In this script I don't have OnPlayerRequestClass, I only have that in the gamemode, this is just a filterscript.