PDA

View Full Version : Fraktion Car problem


KampfMopZZ
10/10/2011, 02:54 PM
Hi,
i have a problem wih my fraktioncars, i think its just a little error, because it worked, but since i added more fractioncars, i wont work anymore :( the gangs "polizei" and "bundeswehr" worked, but then i addet FBI an now i can drive all cars.

Thank you for your help!
KampfmOpZ

// Includes========================================== ===========================
#include <a_samp>
#include <dini>
// Farben============================================ ===========================
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_GREY 0xAFAFAFAA
// Pragmas=========================================== ===========================
#pragma tabsize 0
#pragma unused strtok
// Teams============================================= ===========================
#define TEAM_POLIZEI 1
#define TEAM_BUNDESWEHR 2
#define TEAM_KRANKENHAUS 3
#define TEAM_FBI 4
#define TEAM_NANG 5
#define TEAM_BIKER 6
#define TEAM_STADTWERKE 7
#define TEAM_69 8
#define TEAM_AUFTRAGSMÖRDER 9
#define TEAM_TRIADEN 10
#define TEAM_NTV 11
// Enums============================================= ===========================
enum spieler_daten
{
wanted,
skin,
leader,
team,
money,
score,
eingeloggt,
}
// NEW´S============================================= ===========================
new Spieler[MAX_PLAYERS][spieler_daten];
new polizeiauto[16];
new bundeswauto[19];
new kranken[8];
new fbiauto[5];
new ntvan[4];
// Defines=========================================== ===========================
#define DIALOG_LOGIN 3
#define DIALOG_REG 4
// Mainscript======================================== ===========================
main()
{
print("\n----------------------------------");
print(" LIFE by KampfMopZ");
print("----------------------------------\n");
}
// OnGameModeInt===================================== ===========================
public OnGameModeInit()
{
SetGameModeText("German Reallife");
AddPlayerClass(20,-1493.0544,920.2812,7.1875,86.9809,0,0,0,0,0,0);
polizeiauto[3] =SetVehicleNumberPlate(AddStaticVehicle(597,-1604.2117,692.8202,-5.4755,359.9847,154,8), "SF PD 1"); // pdc1
polizeiauto[4] =SetVehicleNumberPlate(AddStaticVehicle(597,-1608.3284,692.9455,-5.4751,0.4614,154,8), "SF PD 2"); // pdc2
polizeiauto[5] =SetVehicleNumberPlate(AddStaticVehicle(597,-1612.4637,692.5858,-5.4746,358.9798,154,8), "SF PD 3"); // pdc3
polizeiauto[6] =SetVehicleNumberPlate(AddStaticVehicle(597,-1620.7800,692.8258,-5.4743,359.2848,154,8), "SF PD 4"); // pdc4
polizeiauto[7] =SetVehicleNumberPlate(AddStaticVehicle(597,-1624.8047,693.2934,-5.4738,0.1482,154,8), "SF PD 5"); // pdc5
polizeiauto[8] =SetVehicleNumberPlate(AddStaticVehicle(523,-1573.4670,705.7117,-5.6805,266.1436,154,8), "SF PD 6"); // pdbk1
polizeiauto[9] =SetVehicleNumberPlate(AddStaticVehicle(523,-1574.0304,714.0052,-5.6844,277.8519,154,8), "SF PD 7"); // pdbk3
polizeiauto[10] =SetVehicleNumberPlate(AddStaticVehicle(427,-1623.0857,653.6704,-5.4741,270.8814,154,8), "SF PD 8"); // pdswt1
polizeiauto[11] =SetVehicleNumberPlate(AddStaticVehicle(601,-1638.7889,653.8557,-5.4748,272.0478,154,8), "SF PD 9"); // pdwp1
polizeiauto[12] =SetVehicleNumberPlate(AddStaticVehicle(497,-1680.1832,705.0397,30.1683,91.5802,154,8), "SF PD 10"); // pdhl1
polizeiauto[13] =SetVehicleNumberPlate(AddStaticVehicle(599,-1579.8362,748.8583,-5.4761,358.6972,154,8), "SF PD 11"); // pdrngr1
polizeiauto[14] =SetVehicleNumberPlate(AddStaticVehicle(599,-1587.9021,749.0549,-5.4748,358.7990,154,8), "SF PD 12"); // pdrngr2
polizeiauto[15] =SetVehicleNumberPlate(AddStaticVehicle(599,-1596.4919,748.8757,-5.4737,0.1798,154,8), "SF PD 13"); // pdrngr3
bundeswauto[0] =SetVehicleNumberPlate(AddStaticVehicle(597,-1530.4851,372.4554,6.9561,271.6654,110,8), "SF BW 1"); // bw car 2
bundeswauto[1] =SetVehicleNumberPlate(AddStaticVehicle(597,-1531.3970,378.4416,6.9557,267.3384,110,8), "SF BW 2"); // bw car 3
bundeswauto[2] =SetVehicleNumberPlate(AddStaticVehicle(597,-1530.9556,387.1899,6.9546,268.9381,110,8), "SF BW 3"); // bw car 4
bundeswauto[3] =SetVehicleNumberPlate(AddStaticVehicle(597,-1530.2909,393.4598,6.9569,272.2772,110,8), "SF BW 4"); // bw car 5
bundeswauto[4] =SetVehicleNumberPlate(AddStaticVehicle(522,-1530.1858,401.3380,6.9544,266.6091,110,8), "SF BW 5"); // bw bike 1
bundeswauto[5] =SetVehicleNumberPlate(AddStaticVehicle(522,-1530.2229,407.7654,6.9535,268.9252,110,8), "SF BW 6"); // bw bike 2
bundeswauto[6] =SetVehicleNumberPlate(AddStaticVehicle(522,-1532.4967,416.6087,6.9548,269.1780,110,8), "SF BW 7"); // bw bike 3
bundeswauto[7] =SetVehicleNumberPlate(AddStaticVehicle(433,-1563.0604,364.3815,6.9571,180.3716,110,8), "SF BW 8"); // bw truck 1
bundeswauto[8] =SetVehicleNumberPlate(AddStaticVehicle(433,-1571.1772,364.7406,6.9556,179.5903,110,8), "SF BW 9"); // bw truck 2
bundeswauto[9] =SetVehicleNumberPlate(AddStaticVehicle(470,-1583.0801,366.3289,6.9550,179.7549,110,8), "SF BW 10"); // bw hw 1
bundeswauto[10] =SetVehicleNumberPlate(AddStaticVehicle(470,-1592.4819,365.0593,6.9542,181.7747,110,8), "SF BW 11"); // bw hw 2
bundeswauto[11] =SetVehicleNumberPlate(AddStaticVehicle(470,-1601.2261,364.3669,6.9476,177.3221,110,8), "SF BW 12"); // bw hw 3
bundeswauto[12] =SetVehicleNumberPlate(AddStaticVehicle(520,-1619.2655,286.9609,6.9540,182.1717,110,8), "SF BW 13"); // bw hydra 1
bundeswauto[13] =SetVehicleNumberPlate(AddStaticVehicle(520,-1597.4733,281.6930,6.9563,1.7027,110,8), "SF BW 14"); // bw hydra 2
bundeswauto[14] =SetVehicleNumberPlate(AddStaticVehicle(597,-1615.5392,347.3820,6.9567,269.5211,110,8), "SF BW 15"); // bw panzer 1
bundeswauto[15] =SetVehicleNumberPlate(AddStaticVehicle(597,-1616.5613,330.8249,6.9580,271.3612,110,8), "SF BW 16"); // bw panzer 2
bundeswauto[16] =SetVehicleNumberPlate(AddStaticVehicle(425,-1663.1207,290.1114,6.9563,183.7120,110,8), "SF BW 17"); // bw heli 1
bundeswauto[17] =SetVehicleNumberPlate(AddStaticVehicle(425,-1690.1876,285.5459,6.9540,183.4570,110,8), "SF BW 18"); // bw heli 2w
bundeswauto[18] =SetVehicleNumberPlate(AddStaticVehicle(539,-1249.1276,465.8759,6.9573,271.5680,110,8), "SF BW 19"); // bw hover 1
kranken[0] =SetVehicleNumberPlate(AddStaticVehicle(416,-2625.8535,629.5129,14.2244,91.2881,151,8), "SF KH 1"); // kh kw 1
kranken[1] =SetVehicleNumberPlate(AddStaticVehicle(416,-2661.3601,629.5240,14.2237,92.2785,151,8), "SF KH 2"); // kh kw 2
kranken[2] =SetVehicleNumberPlate(AddStaticVehicle(416,-2701.3545,611.3842,14.2224,168.0612,151,8), "SF KH 3"); // kh kw
kranken[3] =SetVehicleNumberPlate(AddStaticVehicle(597,-2543.5801,586.7440,14.2221,271.3540,151,8), "SF KH 4"); // kh sw
kranken[4] =SetVehicleNumberPlate(AddStaticVehicle(597,-2544.2686,604.7777,14.2222,270.7252,151,8), "SF KH 5"); // kh sw
kranken[5] =SetVehicleNumberPlate(AddStaticVehicle(597,-2571.9055,621.9138,14.2213,90.1400,151,8), "SF KH 6"); // kh sw
kranken[6] =SetVehicleNumberPlate(AddStaticVehicle(563,-2553.3538,639.9899,27.5802,180.0637,151,8), "SF KH 7"); // kh heli
kranken[7] =SetVehicleNumberPlate(AddStaticVehicle(563,-2582.2620,639.7314,27.5802,178.8248,151,8), "SF KH 8"); // kh heli
fbiauto[0] =SetVehicleNumberPlate(AddStaticVehicle(490,-2429.4709,515.0781,29.7020,37.5083,0,3), "SF FBI 1"); // fbi car 1
fbiauto[1] =SetVehicleNumberPlate(AddStaticVehicle(490,-2425.2915,517.9053,29.7017,40.5941,0,3), "SF FBI 2"); // fbi car 2
fbiauto[2] =SetVehicleNumberPlate(AddStaticVehicle(490,-2421.7239,521.5110,29.7021,44.8528,0,3), "SF FBI 3"); // fbi car 1
fbiauto[3] =SetVehicleNumberPlate(AddStaticVehicle(528,-2418.6228,524.4431,29.7006,47.7059,0,3), "SF FBI 4"); // fbi truxck
fbiauto[4] =SetVehicleNumberPlate(AddStaticVehicle(528,-2416.1704,528.3270,29.7022,58.5548,0,3), "SF FBI 5"); // fbi truck 1
ntvan[0] =SetVehicleNumberPlate(AddStaticVehicle(415,-1809.0505,571.6877,34.9393,270.7578,0,3), "SF NTV 1"); // ntv van 1
ntvan[1] =SetVehicleNumberPlate(AddStaticVehicle(415,-1794.3364,555.2484,34.9358,154.1037,0,3), "SF NTV 2"); // ntv van 2
ntvan[2] =SetVehicleNumberPlate(AddStaticVehicle(415,-1816.4503,550.5350,34.9349,32.8511,0,3), "SF NTV 3"); // ntv van 3
ntvan[3] =SetVehicleNumberPlate(AddStaticVehicle(415,-1778.4390,543.9415,34.8230,152.8627,0,3), "SF NTV 4"); // ntv heli

return 1;
}
// OnPlayerRequestClass============================== ===========================
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
// OnPlayerConnect=================================== ===========================
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(fexist(accFormat))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich mit deinem Passwort ein",">>>>>","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich bei uns","Fertig","Abbrechen");
}
return 1;
}
// OnPlayerDisconnect================================ ===========================
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
dini_IntSet(accFormat, "skin", GetPlayerSkin(playerid));

if(fexist(accFormat) && Spieler[playerid][eingeloggt])
{
dini_IntSet(accFormat,"team",Spieler[playerid][team]);
dini_IntSet(accFormat,"leader",Spieler[playerid][leader]);
dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
}
Spieler[playerid][team] = 0;
Spieler[playerid][eingeloggt] = 0;
Spieler[playerid][leader] = 0;
Spieler[playerid][wanted] = 0;
Spieler[playerid][skin] = GetPlayerSkin(playerid);
return 1;
}
// OnPlayerDeath===================================== ===========================
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
SetPlayerSkin(playerid, dini_Int(accFormat,"skin"));
{

}
if(Spieler[playerid][team] == 1) //team polizei
{
SetPlayerPos(playerid, -1606.1589,674.1307,-5.2422 );
SetPlayerFacingAngle(playerid,356.4575);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 280);
GivePlayerWeapon(playerid, 24, 86); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 3, 0);
}
if(Spieler[playerid][team] == 2) //team Bundeswehr
{
SetPlayerPos(playerid, -1522.3591,481.0969,7.1875 );
SetPlayerFacingAngle(playerid,6.2783);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 287);
GivePlayerWeapon(playerid, 24, 50); GivePlayerWeapon(playerid, 31, 170); GivePlayerWeapon(playerid, 27, 84);
}
if(Spieler[playerid][team] == 3) //team Krankenhaus
{
SetPlayerPos(playerid, -2706.5664,638.3166,14.4545 );
SetPlayerFacingAngle(playerid,228.5291);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 276);
GivePlayerWeapon(playerid, 24, 14);
}
if(Spieler[playerid][team] == 4) //team FBI
{
SetPlayerPos(playerid, -2446.5183,517.1216,30.2308 );
SetPlayerFacingAngle(playerid,281.0992);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 286);
GivePlayerWeapon(playerid, 24, 86); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 17, 2);
}
if(Spieler[playerid][team] == 5) //team Nang
{
SetPlayerPos(playerid, -2648.2249,1399.6024,912.4063 );
SetPlayerFacingAngle(playerid,10.9668);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 122);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 29, 150); GivePlayerWeapon(playerid, 18, 2);
}
if(Spieler[playerid][team] == 6) //team BIKER
{
SetPlayerPos(playerid, 488.2935,-81.4488,998.7578 );
SetPlayerFacingAngle(playerid,358.9058);
SetPlayerInterior(playerid, 6);
SetPlayerSkin(playerid, 247);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 25, 28); GivePlayerWeapon(playerid, 7, 0);
}
if(Spieler[playerid][team] == 7) //team Stadtwwerke
{
SetPlayerPos(playerid, -1716.7948,1018.0562,17.5859 );
SetPlayerFacingAngle(playerid,82.8659);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 50);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 6, 0);
}
if(Spieler[playerid][team] == 8) //team 69´
{
SetPlayerPos(playerid, -1629.3293,1388.8190,7.1875 );
SetPlayerFacingAngle(playerid,327.5006);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 144);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 5, 0); GivePlayerWeapon(playerid, 27, 28);

}
if(Spieler[playerid][team] == 9) //team Auftragskiller
{
SetPlayerPos(playerid, 2183.2971,-1203.6145,1049.0234 );
SetPlayerFacingAngle(playerid,264.5049);
SetPlayerInterior(playerid, 3);
SetPlayerSkin(playerid, 125);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 30, 90); GivePlayerWeapon(playerid, 34, 14);

}
if(Spieler[playerid][team] == 10) //team Triaden
{
SetPlayerPos(playerid, 2319.5195,-1209.2161,1049.0234 );
SetPlayerFacingAngle(playerid,100.2676);
SetPlayerInterior(playerid, 3);
SetPlayerSkin(playerid, 117);
GivePlayerWeapon(playerid, 24, 28); GivePlayerWeapon(playerid, 8, 0); GivePlayerWeapon(playerid, 30, 120);
}
if(Spieler[playerid][team] == 11) //team ntv
{
SetPlayerPos(playerid, -1806.5148,530.7881,35.1641 );
SetPlayerFacingAngle(playerid,358.4587);
SetPlayerInterior(playerid, 0);
SetPlayerSkin(playerid, 188);
GivePlayerWeapon(playerid, 43, 45); GivePlayerWeapon(playerid, 24, 28);
}
return 1;
}
// onPlayerCommandText=============================== ===========================
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(strget(cmdtext,0),"/makeleader"))
{
if(IsPlayerAdmin(playerid))
{
if(!strlen(strget(cmdtext,1)))
return
SendClientMessage(playerid,COLOR_GREY,"Benutze: /makeleader [ID] [FraktionsID]");
new string[128];
new id3 = strval(strget(cmdtext,1));
new admin3[MAX_PLAYER_NAME];
new gang = strval(strget(cmdtext,2));
GetPlayerName(id3,admin3,sizeof(admin3));
format(string, sizeof(string), "*** Du wurdest von Admin %s zum Leader der Fraktionsnummer %d gemacht.", admin3, gang);
SendClientMessage(id3, COLOR_LIGHTRED, string);
format(string, sizeof(string), "*** Du hast %s zum Leader der Fraktionsnummer %d gemacht.", id3, gang);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(gang==1) { SetPlayerSkin(id3,280);Spieler[playerid][leader]= 1; }

Spieler[id3][leader] = gang;
Spieler[id3][team] = gang;

}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED,"Du darfst diesen Befehl nicht benutzen !");
}
return 1;
}

if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof polizeiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == polizeiauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_POLIZEI || Spieler[playerid][team] != TEAM_POLIZEI )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof bundeswauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == bundeswauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_BUNDESWEHR || Spieler[playerid][team] != TEAM_BUNDESWEHR )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof kranken; i++ )
{
if( GetPlayerVehicleID( playerid ) == kranken[ i ] )
{
if( Spieler[playerid][team] != TEAM_KRANKENHAUS || Spieler[playerid][team] != TEAM_KRANKENHAUS )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof fbiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == fbiauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_FBI || Spieler[playerid][team] != TEAM_FBI )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof ntvan; i++ )
{
if( GetPlayerVehicleID( playerid ) == ntvan[ i ] )
{
if( Spieler[playerid][team] != TEAM_NTV || Spieler[playerid][team] != TEAM_NTV )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
return 1;
}
// OnDialogResponse================================== ===========================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.datei",pname);
if(response)
{
switch(dialogid) // dialogid auswählen
{
case DIALOG_LOGIN: // ID Login
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
{
Spieler[playerid][team] = dini_Int(accFormat,"team");
Spieler[playerid][leader] = dini_Int(accFormat,"leader");
Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
Spieler[playerid][skin] =SetPlayerSkin(playerid, dini_Int(accFormat,"skin"));
Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt und kannst nun spawnen.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich mit deinem Passwortein",">>>>>","Abbrechen");
SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war falsch!");
}
}
case DIALOG_REG: // ID Registrieren
{
if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich auf unserem Server","Fertig","Abbrechen");
return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
}
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",inputtext);
Spieler[playerid][eingeloggt] = 1;
SendClientMessage(playerid,0xFFFFFFFF,"Account wurde gespeichert, du kannst jetzt spawnen.");
}
}
}
else
{
switch(dialogid)
{
case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGI N,1,"Login","Bitte logge dich ein",">>>>>","Abbrechen");
case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Fertig","Abbrechen");
}
}
return 1;
}
// OnPlayerClickPlayer=============================== ===========================
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
// Socks&so================================================ =====================
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS;
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}
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;
}

KampfMopZZ
10/10/2011, 02:59 PM
Problem solved, the numberplates... close please

aRoach
10/10/2011, 03:02 PM
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if( newstate == PLAYER_STATE_DRIVER )
{
for( new i = 0; i < sizeof polizeiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == polizeiauto[ i ] )
{
if
(
Spieler[playerid][team] != TEAM_POLIZEI || Spieler[playerid][team] != TEAM_POLIZEI ||
Spieler[playerid][team] != TEAM_FBI || Spieler[playerid][team] != TEAM_FBI
)
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
for( new i = 0; i < sizeof bundeswauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == bundeswauto[ i ] )
{
if( Spieler[playerid][team] != TEAM_BUNDESWEHR || Spieler[playerid][team] != TEAM_BUNDESWEHR )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
for( new i = 0; i < sizeof kranken; i++ )
{
if( GetPlayerVehicleID( playerid ) == kranken[ i ] )
{
if( Spieler[playerid][team] != TEAM_KRANKENHAUS || Spieler[playerid][team] != TEAM_KRANKENHAUS )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
for( new i = 0; i < sizeof fbiauto; i++ )
{
if( GetPlayerVehicleID( playerid ) == fbiauto[ i ] )
{
if
(
Spieler[playerid][team] != TEAM_POLIZEI || Spieler[playerid][team] != TEAM_POLIZEI ||
Spieler[playerid][team] != TEAM_FBI || Spieler[playerid][team] != TEAM_FBI
)
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
for( new i = 0; i < sizeof ntvan; i++ )
{
if( GetPlayerVehicleID( playerid ) == ntvan[ i ] )
{
if( Spieler[playerid][team] != TEAM_NTV || Spieler[playerid][team] != TEAM_NTV )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, COLOR_LIGHTRED, "Du hast keine Schlüssel für dieses Fahrzeug.");
}
}
}
}
return 1;
}
It's better when you use ony one time if( newstate == PLAYER_STATE_DRIVER )...