[Help]CMD broken?
#1

Please fix it, it doesnt work;
Код:
	if (strcmp("/admincar", cmdtext, true, 10) == 0)
	{
		new Float:x, Float:y, Float:z;
  		GetPlayerPos(playerid, x, y, z);
 		if(IsPlayerAdmin(playerid))
	 	{
		SendClientMessage(playerid,COLOR_LIGHT_BLUE,"[Admin] Spawned Cheetah");
		AddStaticVehicle(415, x, y, z, 270.0, 161,0);
		return 1;
		}
	}
Cant see any probs!

Also I got a jail CMD, it works but I want it to put person somewhere and make him/her stay here for 60 secs Frozen
Код:
 	if (strcmp("/gotojail", cmdtext, true, 10) == 0)
	{
		if (wantedlevel == 3)
		{
		GivePlayerMoney(playerid, -700);
		SendClientMessage(playerid, COLOR_OOC, "[Jail] You went to jail - $700");
		SetPlayerWantedLevel(playerid, 0);
		return 1;
		}
		if (wantedlevel >= 4)
		{
		GivePlayerMoney(playerid, -1250);
		SendClientMessage(playerid, COLOR_OOC, "[Jail] You went to jail - $1250");
		SetPlayerWantedLevel(playerid, 0);
		return 1;
		}
		if (wantedlevel <= 2)
		{
		SendClientMessage(playerid, COLOR_OOC, "[Jail] You must pay a ticket");
		return 1;
		}

	}
Reply
#2

AddStaticVehicle function can only create vehicle at OnGameModeInit function, use CreateVehicle instead - https://sampwiki.blast.hk/wiki/CreateVehicle

And for the other thing - use the timer for that.
Reply
#3

I know but how can I freeze the person and reset the timer
Reply
#4

A solution is to create a function that unfreezes a player. You freeze the player and call the function after a set time using SetTimerEx.
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)