Quote:
Originally Posted by Ritchie999
Still the same problem
pawn Код:
GivePlayerWeapon(playerid, 24, 99999); GivePlayerWeapon(playerid, 3, 0); GivePlayerWeapon(playerid, 41, 99999); GivePlayerWeapon(playerid, 31, 99999); CopOnDuty[playerid] = 1; randa = random(sizeof(randomskins)); SetPlayerSkin(playerid, randa); format(string, sizeof(string), "[LSPD:] %s is now an on duty police officer.",GetPlayerNameEx(playerid)); SendFactionTypeMessage(1, COLOR_LSPD, string); return 1;
pawn Код:
new randomskins[] = { 29, 47, 48, 285 };
And i also added "new rand = random" at the top of OnPlayercommandtext with the "new string" and "new tmp"
|
That's because you're setting the player skin to the random number, which is between 0 and 4 in this case. You want to use the random number to extract a value from the array, so simply replace your SetPlayerSkin with this:
pawn Код:
SetPlayerSkin(playerid, randomskins[randa]);