SA-MP Forums Archive
how to - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to (/showthread.php?tid=276568)



how to - [LHT]Bally - 14.08.2011

How do i add that if a player kills another player, the player who did the killing gets 6 wanted stars ?

also how can i make a command that restarts my server and all players reconnect right away?


Re: how to - Grim_ - 14.08.2011

For the first look at the OnPlayerDeath callback and SetPlayerWantedLevel function. In the callback, you would need to set the wanted level of the 'killerid' parameter.
pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
{
   SetPlayerWantedLevel( killerid, 6 );
   return 1;
}
For the second, you would need to use the SendRconCommand with the option of 'gmx', which is a server restart. Players are automatically re-connected when the restart is complete:
pawn Код:
COMMAND:gmx( playerid, params[ ] )
{
   if( !IsPlayerAdmin( playerid ) ) return 0; // If not an admin, don't perform the command
   SendRconCommand( "gmx" );
   return 1;
}

// Alternatively, you could just use the default rcon command, /rcon gmx



Re: how to - [LHT]Bally - 14.08.2011

thankyoooooooooou