Ich suche ein Invite System, also ein Leader einer Fraktion/Gang kann mit /invite [ID] einen Spieler zu seiner Frak/Gang einladen, der Spieler bekommt dann eine nachricht, die er mit /invite accept oder /invite cancel wählen kann.
wenn der /invite accept eingibt, soll er bei der Fraktion an der Base immer spawnen, und die Fraktionautos fahren.
Spawns sehen bei mir so aus:
public OnPlayerSpawn(playerid)
{
switch(GetPVarInt(playerid,"Fraktion"))
{
case 0:{}
case 1:{SetPlayerSkin(playerid,283);SetPlayerPos(playerid,sapdspawn);GivePlayerWeapon(playerid,29,250);GivePlayerWeapon(playerid,24,75);}
case 2:{SetPlayerSkin(playerid,108);SetPlayerPos(playerid,vagosspawn);GivePlayerWeapon(playerid,24,100);}
case 3:{SetPlayerSkin(playerid,115);SetPlayerPos(playerid,aztecasspawn);GivePlayerWeapon(playerid,24,100);}
case 4:{SetPlayerSkin(playerid,275);SetPlayerPos(playerid,medicspawn);}
case 5:{SetPlayerSkin(playerid,104);SetPlayerPos(playerid,ballasspawn);GivePlayerWeapon(playerid,24,100);}
case 6:{SetPlayerSkin(playerid,107);SetPlayerPos(playerid,grovespawn);GivePlayerWeapon(playerid,24,100);}
}
return 1;
}
& mein Fraktionsautosystem so:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==sapdcar)
{
if(GetPVarInt(playerid,"Fraktion")!=1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Polizist.");
}
}
}
}
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==vagoscar)
{
if(GetPVarInt(playerid,"Fraktion")!=2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der Vagos.");
}
}
}
}
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==aztecascar)
{
if(GetPVarInt(playerid,"Fraktion")!=3)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der Aztecas.");
}
}
}
}
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==mediccar)
{
if(GetPVarInt(playerid,"Fraktion")!=4)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der Medics.");
}
}
}
}
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==ballascar)
{
if(GetPVarInt(playerid,"Fraktion")!=5)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der Ballas.");
}
}
}
}
if(newstate==PLAYER_STATE_DRIVER)
{
for(new i=0; i {
if(GetPlayerVehicleID(playerid)==grovecar)
{
if(GetPVarInt(playerid,"Fraktion")!=6)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der Grove Street.");
}
}
}
}
return 1;
}