26.09.2010, 15:58
Can someone help me or not?
if(strcmp(...)) //Your oygate command
{
if(GetPlayerSkin(playerid) != the_skin_id_that_is_allowed_to_open) return 1; //ends the command here
//your further normal gate code
...
}
if(strcmp(...)) //Your oygate command
{
if(GetPlayerSkin(playerid) != the_skin_id_that_is_allowed_to_open) return 1; //ends the command here
//your further normal gate code
...
}
What i wrote: [quote] if(strcmp(cmdtext, "/Pgopen", true) == 0) { if(GetPlayerSkin(playerid) != 24) return 1; //ends the command here new string[50]; new movetime = MoveObject(gate, -224.91983032,929.99670410,-8.98811340,5); format(string, sizeof(string), "Prison Gates Are Opening", movetime); SendClientMessage(playerid, 0xFF000000, string); return 1; }
C:\Users\Alle\Desktop\GTA SA Shit\GTA Server\gamemodes\EQ-RP.pwn(542) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
Originally Posted by Whatever your name is
[/code]
The error. Код:
C:\Users\Alle\Desktop\GTA SA Shit\GTA Server\gamemodes\EQ-RP.pwn(542) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. |
format(str, sizeof(str), "Vehicles/Players/%s.cfg", plname);
if(dini_Exists(str))
{
strmid(PlayerVehicle[playerid][pVeh1], dini_Get(str, "Vehicle1"), 0, strlen(dini_Get(str, "Vehicle1")), 255);
strmid(PlayerVehicle[playerid][pVeh2], dini_Get(str, "Vehicle2"), 0, strlen(dini_Get(str, "Vehicle2")), 255);
strmid(PlayerVehicle[playerid][pVeh3], dini_Get(str, "Vehicle3"), 0, strlen(dini_Get(str, "Vehicle3")), 255);
strmid(PlayerVehicle[playerid][pVeh4], dini_Get(str, "Vehicle4"), 0, strlen(dini_Get(str, "Vehicle4")), 255);
strmid(PlayerVehicle[playerid][pVeh5], dini_Get(str, "Vehicle5"), 0, strlen(dini_Get(str, "Vehicle5")), 255);
return 1;
}
else
{
dini_Create(str);
strmid(PlayerVehicle[playerid][pVeh1], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh2], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh3], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh4], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh5], "None", 0, strlen("None"), 255);
//return 1;
}
Can someone explain me what means == 0 in this code: if(strcmp(cmdtext, "/mycommand") == 0).I think everyone know this code-begginer and also proffesional, but I want to know everything about that, because in another code 0 will be interprete like disabled and 1 like enabled, but in this code it's not disabled if player entered code matches text /mycommand.Thank you for the helping!
|
strcmp returns 0 if the two strings match so a quicker way to write that would be:
pawn Код:
pawn Код:
|