Sziasztok! Hoztam egy scriptet, amivel RCON adminok egy parancsal respawnolhatják a jármût.
if (strcmp(\"/rj\", cmdtext, true) == 0) // írd át, ha szeretnéd.
{
if(!IsPlayerAdmin(playerid)) else SendClientMessage(playerid, COLOR_RED, \"HIBA: Te nem vagy Admin\");
{
}
new pName[MAX_PLAYER_NAME];
new string[200];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), \"%s respawnolta egy autót\", pName);
SendClientMessageToAll(0xAFAFAFAA, string);
new jarmuid = GetPlayerVehicleID(playerid);
SetVehicleToRespawn(jarmuid);
TogglePlayerControllable(playerid, 1);
return 1;
}
Letöltési link: HAMAROSAN!
Készítõ: Én(leito222)
A scriptet régebben írtam, úgy 3hónapja, még a régi modemból szedtem ki, és gondoltam megosztom veletek.
Használata: Beszállsz az autóba, és beírod /rj, ezzel az autó eltünik alólad, és respawnolódik.
Szerintem így azért használhatóbb:
#include a_samp
public OnPlayerCommandText( playerid, cmdtext[] )
{
new parancs[256], tmp[256];
new idx, id;
parancs = strtok(cmdtext, idx);
id = strval(tmp);
if( strcmp( parancs, \"/rj\", true) == 0 )
{
if( !IsPlayerAdmin(playerid) ) return SendClientMessage( playerid, -1, \"Használatához adminnak kell lenned!\" );
tmp = strtok( cmdtext, idx );
if( !strlen(tmp) ) return SendClientMessage( playerid, -1, \"Használat: /rj <Jármû ID>\" );
/* ------------------------------------------------------------------------------------------- */
id = strval(tmp);
SetVehicleToRespawn(id);
return 1;
}
return 0;
}
//----------------------------------------------------------
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= \' \'))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
//------------------------------------------------
//------------------------------------------------
stock isNumeric(const string[])
{
new length=strlen(string);
if (length==0) return false;
for (new i = 0; i < length; i++)
{
if (
(string > \'9\' || string < \'0\' && string!=\'-\' && string!=\'+\') // Not a number,\'+\' or \'-\'
|| (string==\'-\' && i!=0) // A \'-\' but not at first.
|| (string==\'+\' && i!=0) // A \'+\' but not at first.
) return false;
}
if (length==1 && (string[0]==\'-\' || string[0]==\'+\')) return false;
return true;
}
//------------------------------------------------
E:
A tiedben észrevettem valami furát..:
if(!IsPlayerAdmin(playerid)) else SendClientMessage(playerid, COLOR_RED, \"HIBA: Te nem vagy Admin\");
ez inkább:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, \"HIBA: Te nem vagy Admin\");