Problem on Command
#1

Hello!
Why This Command Dosen't work?
http://pastebin.com/QDdCXwQx

Its Says: This Command Dosen't Exist!
And The Other Commands work..
But When I Write Something [like sasasadsa] , its saying:
* You Bought a driver license , drive carefully!

why i need to do ?

and 1 more thing , in OnPlayerConnect , i did:
License[playerid] = 0;
Reply
#2

pawn Код:
if (strcmp("/BuyDL", cmdtext, true, 10) == 0)
 {
 if(License[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Already Have a driver license.");
 } // don't need this bracket you returned already ^^^
 else // you don't need this too.
 { // ==
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Dont have enough money to buy a driver license (30,000$)!");
 SendClientMessage(playerid, COLOR_GREEN, "* {C0C0C0}You Bought a driver license , drive carefully!");
 License[playerid] = 1;
 return 1;
 }
pawn Код:
if (strcmp("/BuyDL", cmdtext, true, 10) == 0)
 {
 if(License[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Already Have a driver license.");
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Dont have enough money to buy a driver license (30,000$)!");
 SendClientMessage(playerid, COLOR_GREEN, "* {C0C0C0}You Bought a driver license , drive carefully!");
 License[playerid] = 1;
 return 1;
 }
If you are checking for VARIABLE = 1 (license = 1) you don't need to re-check if its 0, because if its not 1, then its 0.
Also this command works if you type /buydl only no parameters.
Reply
#3

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
pawn Код:
if (strcmp("/BuyDL", cmdtext, true, 10) == 0)
 {
 if(License[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Already Have a driver license.");
 } // don't need this bracket you returned already ^^^
 else // you don't need this too.
 { // ==
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Dont have enough money to buy a driver license (30,000$)!");
 SendClientMessage(playerid, COLOR_GREEN, "* {C0C0C0}You Bought a driver license , drive carefully!");
 License[playerid] = 1;
 return 1;
 }
pawn Код:
if (strcmp("/BuyDL", cmdtext, true, 10) == 0)
 {
 if(License[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Already Have a driver license.");
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, COLOR_RED, "* {C0C0C0}You Dont have enough money to buy a driver license (30,000$)!");
 SendClientMessage(playerid, COLOR_GREEN, "* {C0C0C0}You Bought a driver license , drive carefully!");
 License[playerid] = 1;
 return 1;
 }
If you are checking for VARIABLE = 1 (license = 1) you don't need to re-check if its 0, because if its not 1, then its 0.
Also this command works if you type /buydl only no parameters.
wow , thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)