13.03.2011, 14:16
Well it was my Bad i had SetPlayerPos in OnPlayerDeath Also xD
But still
Script
But still
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(1284) : warning 202: number of arguments does not match definition
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(1285) : error 002: only a single statement (or expression) can follow each "case"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\MyScript.pwn(1285) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
switch(random(2)) {
case 1: SetPlayerPos(playerid, -2512.3667,-266.4278,38.9365);
case 2: SetPlayerPos(playerid, 2134.5957,1332.6907,10.8251,85.5904);
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
GivePlayerCash(killerid, 1000);
SendClientMessage(killerid, COLOR_BRIGHTRED, "Nice Shot! You Killed Him");
GivePlayerCash(playerid, -500);
SendClientMessage(playerid, COLOR_BRIGHTRED, "We Need 500 For Your Shroud!");
SetPlayerFacingAngle(playerid,0);
SetPlayerCameraPos(playerid, -2512.5325,-261.5241,39.9224);
SetPlayerCameraLookAt(playerid, -2512.3667,-266.4278,38.9365);
GivePlayerWeapon(playerid,25,1000);
GivePlayerWeapon(playerid,28,1000);
GivePlayerWeapon(playerid,34,500);
GivePlayerWeapon(playerid,24,500);
new name[MAX_PLAYER_NAME];
new string[256];
new deathreason[20];
new playercash;
GetPlayerName(playerid, name, sizeof(name));
GetWeaponName(reason, deathreason, 20);
if (killerid == INVALID_PLAYER_ID) {
switch (reason) {
case WEAPON_DROWN:
{
format(string, sizeof(string), "*** %s drowned.)", name);
}
default:
{
if (strlen(deathreason) > 0) {
format(string, sizeof(string), "*** %s died. (%s)", name, deathreason);
} else {
format(string, sizeof(string), "*** %s died.", name);
}
}
}
}
else {
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
if (strlen(deathreason) > 0) {
format(string, sizeof(string), "*** %s killed %s. (%s)", killer, name, deathreason);
} else {
format(string, sizeof(string), "*** %s killed %s.", killer, name);
}
}
SendClientMessageToAll(COLOR_BRIGHTRED, string);
{
playercash = GetPlayerMoney(playerid);
if (playercash > 0)
{
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
else
{
}
}
return 1;
}