16.07.2010, 13:12
1st error
2nd problem
3rd problem
pawn Код:
COMMAND:pslap(playerid,params,cmdtext[])
{
if(isprem[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You arent a premium member"); return 1;
}
else
{
new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
new string [128];
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pslap [playerid]");
return 1;
}
else
{
new otherplayer = strval(params);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(otherplayer, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(otherplayer, X, Y, Z);
SetPlayerPos(otherplayer, X, Y, Z+10);
format(string, sizeof(string), "\"%s\" was slapped by Admin \"%s\".", giveplayer, sendername);
SendClientMessageToAll(COLOR_YELLOW, string);
}
}
return 1;
}
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) == 520)
{
if(isprem[playerid] == 0 || !IsPlayerBAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "To fly the hydra you must be an administrator or premium member.");
RemovePlayerFromVehicle(playerid); return 1;
}
SendClientMessage(playerid, COLOR_YELLOW, "You enter the Admin/Premium Hydra.");
return 1;
}
else if(GetPlayerVehicleID(playerid) == 447)
{
if(isprem[playerid] == 0 || !IsPlayerBAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "To fly the seasparrow you must be an administrator or premium member.");
RemovePlayerFromVehicle(playerid); return 1;
}
SendClientMessage(playerid, COLOR_YELLOW, "You enter the Admin/Premium Seasparrow.");
return 1;
}
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(isprem[playerid])
{
SetPlayerArmour(playerid, 100);
PlayerPlaySound(playerid, 1098,-119.9460,23.1096,12.2238);
SetPlayerCheckpoint(playerid, 268.7881,1884.0446,-30.0938,5);
if(GetPlayerSkin(playerid) == 98)
{
GivePlayerWeapon(playerid, WEAPON_DEAGLE,500);
GivePlayerWeapon(playerid, WEAPON_UZI,500);
}
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 98)
{
SendClientMessage(playerid, COLOR_RED, "This skin is donator only!");
return 0;
}
return 1;
}