Hier der Code:
public OnPlayerDeath(playerid, killerid, reason)
{
new killername[MAX_PLAYER_NAME];
GetPlayerName(killerid,killername,MAX_PLAYER_NAME);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
if(GetPVarInt(killerid,"Fraktion")==1)
{
if(GetPlayerWantedLevel(playerid)==1)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",5);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==2)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",10);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==3)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",15);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==4)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",20);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==5)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",25);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)>6)
{
new string[128];
format(string,sizeof string,"Officer: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",30);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
}
else if(GetPVarInt(killerid,"Fraktion")==3)
{
if(GetPlayerWantedLevel(playerid)==1)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",5);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==2)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",10);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==3)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",15);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==4)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",20);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)==5)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",25);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
if(GetPlayerWantedLevel(playerid)>6)
{
new string[128];
format(string,sizeof string,"Soldat: %s hat den Gesuchten %s getötet.",killername,playername);
SendClientMessageToAll(Orange,string);
SetTimerEx("KnastTimer",60000,0,"i",playerid);
SetPlayerWantedLevel(playerid, 0);
SetPVarInt(playerid,"Knastzeit",30);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
}
}
dann der timer:
public KnastTimer(playerid)
{
if(GetPVarInt(playerid,"Knastzeit")==30)
{
SetPVarInt(playerid,"Knastzeit",29);
}
else if(GetPVarInt(playerid,"Knastzeit")==29)
{
SetPVarInt(playerid,"Knastzeit",28);
}
else if(GetPVarInt(playerid,"Knastzeit")==28)
{
SetPVarInt(playerid,"Knastzeit",27);
}
else if(GetPVarInt(playerid,"Knastzeit")==27)
{
SetPVarInt(playerid,"Knastzeit",26);
}
else if(GetPVarInt(playerid,"Knastzeit")==26)
{
SetPVarInt(playerid,"Knastzeit",25);
}
else if(GetPVarInt(playerid,"Knastzeit")==25)
{
SetPVarInt(playerid,"Knastzeit",24);
}
else if(GetPVarInt(playerid,"Knastzeit")==24)
{
SetPVarInt(playerid,"Knastzeit",23);
}
else if(GetPVarInt(playerid,"Knastzeit")==23)
{
SetPVarInt(playerid,"Knastzeit",22);
}
else if(GetPVarInt(playerid,"Knastzeit")==22)
{
SetPVarInt(playerid,"Knastzeit",21);
}
else if(GetPVarInt(playerid,"Knastzeit")==21)
{
SetPVarInt(playerid,"Knastzeit",22);
}
else if(GetPVarInt(playerid,"Knastzeit")==20)
{
SetPVarInt(playerid,"Knastzeit",19);
}
else if(GetPVarInt(playerid,"Knastzeit")==19)
{
SetPVarInt(playerid,"Knastzeit",18);
}
else if(GetPVarInt(playerid,"Knastzeit")==18)
{
SetPVarInt(playerid,"Knastzeit",17);
}
else if(GetPVarInt(playerid,"Knastzeit")==17)
{
SetPVarInt(playerid,"Knastzeit",16);
}
else if(GetPVarInt(playerid,"Knastzeit")==16)
{
SetPVarInt(playerid,"Knastzeit",15);
}
else if(GetPVarInt(playerid,"Knastzeit")==15)
{
SetPVarInt(playerid,"Knastzeit",14);
}
else if(GetPVarInt(playerid,"Knastzeit")==14)
{
SetPVarInt(playerid,"Knastzeit",13);
}
else if(GetPVarInt(playerid,"Knastzeit")==13)
{
SetPVarInt(playerid,"Knastzeit",12);
}
else if(GetPVarInt(playerid,"Knastzeit")==12)
{
SetPVarInt(playerid,"Knastzeit",11);
}
else if(GetPVarInt(playerid,"Knastzeit")==11)
{
SetPVarInt(playerid,"Knastzeit",10);
}
else if(GetPVarInt(playerid,"Knastzeit")==10)
{
SetPVarInt(playerid,"Knastzeit",9);
}
else if(GetPVarInt(playerid,"Knastzeit")==9)
{
SetPVarInt(playerid,"Knastzeit",8);
}
else if(GetPVarInt(playerid,"Knastzeit")==8)
{
SetPVarInt(playerid,"Knastzeit",7);
}
else if(GetPVarInt(playerid,"Knastzeit")==7)
{
SetPVarInt(playerid,"Knastzeit",6);
}
else if(GetPVarInt(playerid,"Knastzeit")==6)
{
SetPVarInt(playerid,"Knastzeit",5);
}
else if(GetPVarInt(playerid,"Knastzeit")==5)
{
SetPVarInt(playerid,"Knastzeit",4);
}
else if(GetPVarInt(playerid,"Knastzeit")==4)
{
SetPVarInt(playerid,"Knastzeit",3);
}
else if(GetPVarInt(playerid,"Knastzeit")==3)
{
SetPVarInt(playerid,"Knastzeit",2);
}
else if(GetPVarInt(playerid,"Knastzeit")==2)
{
SetPVarInt(playerid,"Knastzeit",1);
}
else if(GetPVarInt(playerid,"Knastzeit")==1)
{
SetPVarInt(playerid,"Knastzeit",0);
}
else if(GetPVarInt(playerid,"Knastzeit")==0)
{
Spawn(playerid);
SpawnPlayer(playerid);
}
return 1;
}
Dann noch mein stock spawn:
stock Spawn(playerid)
{
new Spieler[512];
new Sname[MAX_PLAYER_NAME];
GetPlayerName(playerid,Sname,sizeof(Sname));
format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",Sname);
if(GetPVarInt(playerid,"Firstconnect")==1)
{
SetPVarInt(playerid,"Firstconnect",0);
//Speichern(playerid); //Speichert die stats
}
else
{
if(GetPVarInt(playerid,"Knastzeit")>1)
{
SetTimerEx("KnastTimer",60000,1,"i",playerid);
SetSpawnInfo(playerid, 0, 62, 263.8622,77.2192,1001.0391,272.8581,0,0,0,0,0,0);
SetPlayerInterior(playerid,6);
}
else if(GetPVarInt(playerid,"Fraktion")==1)
{
SetPlayerColor(playerid, pd);
if(GetPVarInt(playerid,"Fraktionsrang")==0)
{
SetSpawnInfo(playerid, 0, 282, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==1)
{
SetSpawnInfo(playerid, 0, 282, 1526.9788,-1678.0612,5.8906,270.9705,3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==2)
{
SetSpawnInfo(playerid, 0, 280, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==3)
{
SetSpawnInfo(playerid, 0, 281, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==4)
{
SetSpawnInfo(playerid, 0, 283, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==5)
{
SetSpawnInfo(playerid, 0, 288, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==6)
{
SetSpawnInfo(playerid, 0, 288, 1526.9788,-1678.0612,5.8906,270.9705, 3, 1, 22, 500, 29, 1000);
return 1;
}
}
else if(GetPVarInt(playerid,"Fraktion")==2)
{
SetPlayerColor(playerid, normal);
if(GetPVarInt(playerid,"Fraktionsrang")==0)
{
SetSpawnInfo(playerid, 0, 162, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==1)
{
SetSpawnInfo(playerid, 0, 162, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==2)
{
SetSpawnInfo(playerid, 0, 143, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==3)
{
SetSpawnInfo(playerid, 0, 143, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==4)
{
SetSpawnInfo(playerid, 0, 220, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==5)
{
SetSpawnInfo(playerid, 0, 142, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==6)
{
SetSpawnInfo(playerid, 0, 142, 1106.1493,-299.5602,74.5391,89.9890,9,1,22,500,30,1000);
return 1;
}
}
else if(GetPVarInt(playerid,"Fraktion")==3)
{
SetPlayerColor(playerid,army);
if(GetPVarInt(playerid,"Fraktionsrang")==0)
{
SetSpawnInfo(playerid, 0, 287,242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==1)
{
SetSpawnInfo(playerid, 0, 287, 242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==2)
{
SetSpawnInfo(playerid, 0, 287, 242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==3)
{
SetSpawnInfo(playerid, 0, 287, 242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==4)
{
SetSpawnInfo(playerid, 0, 287, 242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==5)
{
SetSpawnInfo(playerid, 0, 287,242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
if(GetPVarInt(playerid,"Fraktionsrang")==6)
{
SetSpawnInfo(playerid, 0, 287, 242.5908,1872.1843,11.4531,91.0368,31,500,22,500,34,100);
return 1;
}
}
else
{
new skinid;
skinid = GetPVarInt(playerid,"Skin");
SetSpawnInfo(playerid,skinid,0,1214.4077,-1813.4712,16.5938,273.2053,0,0,0,0,0,0); //Eigentlicher noob spawn!!!
SetPlayerSkin(playerid,dini_Int(Spieler,"Skin"));
SpawnPlayer(playerid);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerColor(playerid, normal);
return 1;
}
return 1;
}
return 1;
}
Kann vll jemand ein tutorial posten für ein Knast system????