if(strcmp("/extract", cmdtext, true, 5) == 0) { new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(487, x+5, y+5, z, az, -1, -1, 180); SendClientMessage(playerid, RED, "[ATT]: Extraction Has Arrived! (Cost: 1000 Fuel To Deliver)"); PlayerInfo[playerid][FuelAmount] = PlayerInfo[playerid][FuelAmount] -1000; return 1; }
if(strcmp("/extract", cmdtext, true, 5) == 0) { if(PlayerInfo[playerid][FuelAmount] < 1000){ //player has less then 1000 fuel return 0; } else{ new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(487, x+5, y+5, z, az, -1, -1, 180); SendClientMessage(playerid, RED, "[ATT]: Extraction Has Arrived! (Cost: 1000 Fuel To Deliver)"); PlayerInfo[playerid][FuelAmount] = PlayerInfo[playerid][FuelAmount] -1000; return 1; } }
WTF? Are you totally stupid? Or do you really not remember anything from yesterdays posting marathon?
if(PlayerInfo[playerid][FuelAmount] < 1000) return... blah blah blah |
this is how I would do it.
Код:
if(strcmp("/extract", cmdtext, true, 5) == 0) { if(PlayerInfo[playerid][FuelAmount] < 1000){ //player has less then 1000 fuel return 0; } else{ new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(487, x+5, y+5, z, az, -1, -1, 180); SendClientMessage(playerid, RED, "[ATT]: Extraction Has Arrived! (Cost: 1000 Fuel To Deliver)"); PlayerInfo[playerid][FuelAmount] = PlayerInfo[playerid][FuelAmount] -1000; return 1; } } |
why doesnt it have a opening brace b4 the 1st return? theres nothing there?
|
This should have all the info you need.
https://sampwiki.blast.hk/wiki/Category:..._Documentation |
%s %d %i - + ++ < > >> <<//etc
if(strcmp("/extract", cmdtext, true, 5) == 0)
{
if(PlayerInfo[playerid][FuelAmount] < 1000){
//player has less then 1000 fuel
return 0;
}
else{
new Float:x, Float:y, Float:z, Float:az;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, az);
CreateVehicle(487, x+5, y+5, z, az, -1, -1, 180);
SendClientMessage(playerid, RED, "[ATT]: Extraction Has Arrived! (Cost: 1000 Fuel To Deliver)");
PlayerInfo[playerid][FuelAmount] = PlayerInfo[playerid][FuelAmount] -1000;
return 1;
}
}
return 0;
}
if(strcmp("/extract", cmdtext, true, 5) == 0) { if(PlayerInfo[playerid][FuelAmount] < 1000) { return SendClientMessage(playerid, RED, "[ATT]: You Dont Have Enough Fuel For This To Be Delivered!)"); } new Float:x, Float:y, Float:z, Float:az; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, az); CreateVehicle(469, x+5, y+5, z, az, -1, -1, 180); SendClientMessage(playerid, RED, "[ATT]: Extraction Has Arrived! (Cost: 1000 Fuel To Deliver)"); PlayerInfo[playerid][FuelAmount] = PlayerInfo[playerid][FuelAmount] -1000; return 1; }