02.09.2013, 10:47
Hello! I have a problem with my GameMode. I would that when a player dies, it will be spawned. But in my GameMode, when a player dies, it doesn't spawn and the main screen "<< >> Spawn" appears (and sometimes, players has a bottle or a cigar in the hand). Here the script:
SalvaStats(playerid) function:
How can I fix that? Thank you in advance!
(And sorry for my English)
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
GivePlayerWeapon(playerid,3,1);
GivePlayerWeapon(playerid,24,140);
GivePlayerWeapon(playerid,25,20);
GivePlayerWeapon(playerid,29,350);
GivePlayerWeapon(playerid,41,1000);
//TextDrawShowForPlayer(playerid,Orologio);
//gettime(Ore,Minuti);
//SetPlayerTime(playerid,Ore,Minuti);
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
//TextDrawHideForPlayer(playerid,Orologio);
SalvaStats(playerid);
return 1;
}
pawn Код:
stock SalvaStats(playerid)
{
format(query,sizeof(query),"UPDATE `users` SET `Rango` = '%s', `Gruppo` = '%d', `Skin` = '%d', `LastLoginInGame` = '%s', `Ban` = '%d', `Ip` = '%s' WHERE `Username` = '%s'",stats[playerid][Rango],stats[playerid][Gruppo],stats[playerid][Skin],stats[playerid][LastLoginInGame],stats[playerid][ban],stats[playerid][Ip],stats[playerid][Username]);
mysql_query(query);
}
(And sorry for my English)