17.03.2009, 14:08
Hi i have command /gut and when type that then teleport my car to my location but how can i make when in that location is 30 cars cant tele
if (strcmp(cmdtext, "/race", true) == 0) { if (IsPlayerConnected(playerid)) { if (PlayerToPoint(3.0, playerid,-2036.5963,302.3366,34.9292)) { if (IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid), -2084.3301,-216.8675,34.6121); SetPlayerPos(playerid, -2090.3301,-216.8675,34.6121); }//POSITIONS DONE SendClientMessage(playerid, 0xFF66FFAA, "Tu ....! ");
if (strcmp(cmdtext, "/race", true) == 0)
{
if (IsPlayerConnected(playerid))
{
if (PlayerToPoint(3.0, playerid,-2036.5963,302.3366,34.9292))
{
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2084.3301,-216.8675,34.6121);
SetPlayerPos(playerid, -2090.3301,-216.8675,34.6121);
}//POSITIONS DONE
SendClientMessage(playerid, 0xFF66FFAA, "Tu ....! ");
}
}
}
if (IsPlayerConnected(playerid)) {
if (strcmp(cmdtext, "/race", true) == 0)
{
if (!PlayerToPoint(3.0, playerid,-2036.5963,302.3366,34.9292))
return SendClientMessage(playerid, 0xFF66FFAA, "You're not near enough");
if (!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, 0xFF66FFAA, "You're not in a car");
// loop through all vehicles
new vehiclecount;
for (new v = 0; v < MAX_VEHICLES; v++)
{
if (VehicleToPoint(v, 'radius', 'x', 'y', 'z'))
vehiclecount++;
}
if (vehiclecount >= 30)
return SendClientMessage(playerid, 0xFF66FFAA, "Too many vehicles there already");
SetVehiclePos(GetPlayerVehicleID(playerid), -2084.3301,-216.8675,34.6121);
SetPlayerPos(playerid, -2090.3301,-216.8675,34.6121);
return 1;
}
// some where else
stock VehicleToPoint(vehicleid, Float:radi, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
tempposx = (oldposx - x);
tempposy = (oldposy - y);
tempposz = (oldposz - z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
return 1;
return 0;
}
Originally Posted by WoozieRocks
Код:
if (IsPlayerConnected(playerid)) { |
C:\Documents and Settings\Martins\Desktop\SA-MP serveris\gamemodes\Fizzy.pwn(1424) : error 027: invalid character constant C:\Documents and Settings\Martins\Desktop\SA-MP serveris\gamemodes\Fizzy.pwn(1424) : error 029: invalid expression, assumed zero C:\Documents and Settings\Martins\Desktop\SA-MP serveris\gamemodes\Fizzy.pwn(1424) : error 027: invalid character constant C:\Documents and Settings\Martins\Desktop\SA-MP serveris\gamemodes\Fizzy.pwn(1424) : fatal error 107: too many error messages on one line