public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/deathmatch", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 1307.5884,-1158.6796,23.8281); SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the DeathMatch Area!"); if (GetPlayerSkin(0)) { GivePlayerWeapon(playerid, 22, 50); GivePlayerWeapon(playerid, 18, 5); } if (GetPlayerSkin(1)) { GivePlayerWeapon(playerid, 25, 30); GivePlayerWeapon(playerid, 24, 40); } if (GetPlayerSkin(2)) { GivePlayerWeapon(playerid, 23, 40); GivePlayerWeapon(playerid, 26, 35); } return 1; } if (strcmp("/safearea", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 701.5940,-519.2322,16.3302); ResetPlayerWeapons(playerid); SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the Safe Area!"); return 1; } if (strcmp("/buyarmor", cmdtext, true, 10) == 0) { if (GetPlayerMoney(playerid) <1000) { SendClientMessage(playerid, COLOR_GREY, "You need at least 1000 bucks to buy an armor!"); } if (GetPlayerMoney(playerid) >1000) { GivePlayerMoney(playerid, -1000); SetPlayerArmour(playerid, 100); SendClientMessage(playerid, COLOR_YELLOW, "Thanks you for buying an 1000 bucks worth Armor!"); } return 1; } if (strcmp("/kill", cmdtext, true, 10) ==0) { SetPlayerHealth(playerid, 0); SendClientMessage(playerid, COLOR_YELLOW, "You commited a suicide."); return 1; } if (strcmp("/godon", cmdtext, true, 10) ==0) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command."); } if (IsPlayerAdmin(playerid)) { SetPlayerHealth(playerid, INFINITE); SendClientMessage(playerid, COLOR_YELLOW, "You are now GodMode."); } return 1; } if (strcmp("/godoff", cmdtext, true, 10) ==0) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command."); } if (IsPlayerAdmin(playerid)) { new Float:health; GetPlayerHealth(playerid, health); if (health < 100.00000001) { SendClientMessage(playerid, COLOR_GREY, "Your GodMode is already disabled."); } if (health == INFINITE) { SetPlayerHealth(playerid, 99.9); SendClientMessage(playerid, COLOR_YELLOW, "You are no longer GodMode."); } } return 1; } if (strcmp("/infammon", cmdtext, true, 10) ==0) { if(!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command."); } if(IsPlayerAdmin(playerid)) { if (GetPlayerAmmo(playerid) == INFINITE) { SendClientMessage(playerid, COLOR_GREY, "You already have Infinite Ammo activated."); } else { if (GetPlayerSkin(0)) { SetPlayerAmmo(playerid, 22, INFINITE); SetPlayerAmmo(playerid, 18, INFINITE); SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo."); } if (GetPlayerSkin(1)) { SetPlayerAmmo(playerid, 25, INFINITE); SetPlayerAmmo(playerid, 24, INFINITE); SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo."); } if (GetPlayerSkin(2)) { SetPlayerAmmo(playerid, 23, INFINITE); SetPlayerAmmo(playerid, 26, INFINITE); SendClientMessage(playerid, COLOR_YELLOW, "You have now Infinite Ammo."); } } } return 1; } return 0; }
if (strcmp("/kill", cmdtext, true, 10) ==0)
The GetPlayerSkin code is wrong indeed. However, it is still syntactically correct.
|
Not if you know what the intended usage was. They are the skin IDs, not the playerid. Just because it's an int doesn't make it correct.
|