Hallo Leute,
hier ein creategangcar befehl aus einem GF
Aber es geht nicht...
Weiß jemand was da falsch ist?
if(strcmp("/creategangcar", cmd, true) == 0)
{
if(PlayerInfo[playerid][pSQLID] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new GangID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new FFarbe1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new FFarbe2 = strval(tmp);
for(new h = 0; h < sizeof(GangAutoInfo); h++){
if(GangAutoInfo[h][cOwner] == -1 && GangAutoInfo[h][cTyp] == -1 && GangAutoInfo[h][cColor1] == -1 && GangAutoInfo[h][cColor2] == -1){
GangAutoInfo[h][cID] = -1;
GangAutoInfo[h][cOwner] = GangID;
GangAutoInfo[h][cTyp] = GetVehicleModel(GetPlayerVehicleID(playerid));
GetVehiclePos(GetPlayerVehicleID(playerid),GangAutoInfo[h][cPosX],GangAutoInfo[h][cPosY],GangAutoInfo[h][cPosZ]);
GetVehicleZAngle(GetPlayerVehicleID(playerid),GangAutoInfo[h][cRot]);
GangAutoInfo[h][cColor1] = FFarbe1;
GangAutoInfo[h][cColor2] = FFarbe2;
GangAutoInfo[h][cStatus] = 0;
GangAutoInfo[h][cTank] = 100;
GangAutoInfo[h][cMeter] = 0;
DestroyVehicleSelfmade(GetPlayerVehicleID(playerid));
SetTimerEx("CreateNewlyGangAutos",20000,0,"i",h);
SendClientMessage(playerid, COLOR_YELLOW, "Du hast erfolgreich ein Auto erstellt, es spawnt in 20 Sekunden.");
break;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist in keinem Fahrzeug !");
return 1;
}
} }
{
if(PlayerInfo[playerid][pSQLID] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new GangID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new FFarbe1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]");
return 1;
}
new FFarbe2 = strval(tmp);
for(new h = 0; h < sizeof(GangAutoInfo); h++){
if(GangAutoInfo[h][cOwner] == -1 && GangAutoInfo[h][cTyp] == -1 && GangAutoInfo[h][cColor1] == -1 && GangAutoInfo[h][cColor2] == -1){
GangAutoInfo[h][cID] = -1;
GangAutoInfo[h][cOwner] = GangID;
GangAutoInfo[h][cTyp] = GetVehicleModel(GetPlayerVehicleID(playerid));
GetVehiclePos(GetPlayerVehicleID(playerid),GangAutoInfo[h][cPosX],GangAutoInfo[h][cPosY],GangAutoInfo[h][cPosZ]);
GetVehicleZAngle(GetPlayerVehicleID(playerid),GangAutoInfo[h][cRot]);
GangAutoInfo[h][cColor1] = FFarbe1;
GangAutoInfo[h][cColor2] = FFarbe2;
GangAutoInfo[h][cStatus] = 0;
GangAutoInfo[h][cTank] = 100;
GangAutoInfo[h][cMeter] = 0;
DestroyVehicleSelfmade(GetPlayerVehicleID(playerid));
SetTimerEx("CreateNewlyGangAutos",20000,0,"i",h);
SendClientMessage(playerid, COLOR_YELLOW, "Du hast erfolgreich ein Auto erstellt, es spawnt in 20 Sekunden.");
break;
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist in keinem Fahrzeug !");
return 1;
}
} }
Code
if(strcmp("/creategangcar", cmd, true) == 0) { if(PlayerInfo[playerid][pSQLID] == 1) { if(IsPlayerInAnyVehicle(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]"); return 1; } new GangID = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]"); return 1; } new FFarbe1 = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_BENUTZETEXT, "Benutze: /creategangcar [GangID] [Farbe1] [Farbe2]"); return 1; } new FFarbe2 = strval(tmp); for(new h = 0; h < sizeof(GangAutoInfo); h++){ if(GangAutoInfo[h][cOwner] == -1 && GangAutoInfo[h][cTyp] == -1 && GangAutoInfo[h][cColor1] == -1 && GangAutoInfo[h][cColor2] == -1){ GangAutoInfo[h][cID] = -1; GangAutoInfo[h][cOwner] = GangID; GangAutoInfo[h][cTyp] = GetVehicleModel(GetPlayerVehicleID(playerid)); GetVehiclePos(GetPlayerVehicleID(playerid),GangAutoInfo[h][cPosX],GangAutoInfo[h][cPosY],GangAutoInfo[h][cPosZ]); GetVehicleZAngle(GetPlayerVehicleID(playerid),GangAutoInfo[h][cRot]); GangAutoInfo[h][cColor1] = FFarbe1; GangAutoInfo[h][cColor2] = FFarbe2; GangAutoInfo[h][cStatus] = 0; GangAutoInfo[h][cTank] = 100; GangAutoInfo[h][cMeter] = 0; DestroyVehicleSelfmade(GetPlayerVehicleID(playerid)); SetTimerEx("CreateNewlyGangAutos",20000,0,"i",h); SendClientMessage(playerid, COLOR_YELLOW, "Du hast erfolgreich ein Auto erstellt, es spawnt in 20 Sekunden."); break; } } return 1; } else { SendClientMessage(playerid, COLOR_ERRORTEXT, " Du bist in keinem Fahrzeug !"); return 1; } } }