Originally Posted by Gustavob
pawn Код:
if(!strcmp("/ddc1", cmdtext, true)) { if(IsPlayerInAnyVehicle(playerid)) { new ddc1tele; ddc1tele = GetPlayerVehicleID(playerid); SetVehiclePos(ddc1tele, -294.2373,1536.7737,75.5625); new teleddc1[MAX_PLAYER_NAME], string[150]; GetPlayerName(playerid, teleddc1, sizeof(teleddc1)); format(string, sizeof(string), "[INFO] O Player %s foi para DDC-1 (/ddc1)",teleddc1); SendClientMessageToAll(Verde, string); } else { SetPlayerPos(playerid, -294.2373,1536.7737,75.5625); new teleddc2[MAX_PLAYER_NAME], string[150]; GetPlayerName(playerid, teleddc2, sizeof(teleddc2)); format(string, sizeof(string), "[INFO] O Player %s foi para DDC-1 (/ddc1)",teleddc2); SendClientMessageToAll(Verde, string); } return 1; } //ddc2 if(!strcmp("/ddc2", cmdtext, true)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 562) { new ddc2tele; ddc2tele = GetPlayerVehicleID(playerid); SetVehiclePos(ddc2tele, 2291.7197,1392.2921,42.8203); new teleddc2[MAX_PLAYER_NAME], string[150]; GetPlayerName(playerid, teleddc2, sizeof(teleddc2)); format(string, sizeof(string), "[INFO] O Player %s foi para DDC-2 (/ddc2)",teleddc2); SendClientMessageToAll(Verde, string); } else { SetPlayerPos(playerid, 2291.7197,1392.2921,42.8203); new teleddc2[MAX_PLAYER_NAME], string[150]; GetPlayerName(playerid, teleddc2, sizeof(teleddc2)); format(string, sizeof(string), "[INFO] O Player %s foi para DDC-2 (/ddc2)",teleddc2); SendClientMessageToAll(Verde, string); } } else { SetPlayerPos(playerid, 2291.7197,1392.2921,42.8203); new teleddc2[MAX_PLAYER_NAME], string[150]; GetPlayerName(playerid, teleddc2, sizeof(teleddc2)); format(string, sizeof(string), "[INFO] O Player %s foi para DDC-2 (/ddc2)",teleddc2); SendClientMessageToAll(Verde, string); } return 1; }
o problema era que vocк estava fazendo if(!strcmp(blablabla) == 0)), ou vocк usa if(!strcmp(blablabla)) ou if(strcmp(blablabla) == 0).
Nгo diferenзa entre
pawn Код:
if(!strcmp(blablabla)) e if(strcmp(blablabla) == 0);
Eles significam a mesma coisa, acontece que strcmp retorna a quantidade de caracteres diferentes entre as strings, e como colocar um ! й a mesma coisa que checar se a funзгo retorna 0, nгo tem diferenзa.
isso^ checa se a quantidade de caracteres diferentes entre as strings й 1 (creio eu), portanto isso dб na mesma que
pawn Код:
if(!strcmp(blablabla) == 0)
|