All pastes #288924 Raw Edit

jump

public text v1 · immutable
#288924 ·published 2006-12-22 18:36 UTC
rendered paste body
	if(strcmp(cmd, "/jump", true) == 0) {
	    new high;
	
	    GetPlayerName(playerid, giveplayer, MAX_PLAYER_NAME);

     	if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1;

		tmp = strtok(cmdtext, idx);
 		high = strval(tmp);
 		
	    if(!strlen(tmp) || 100 > high || high > 1000)
			SendClientMessage(playerid, COLOR_WHITE, "* WPISZ: /jump [100-1000]");
		else {
			if (GetPlayerMoney(playerid) > 499+high){
				StatGivePlayerMoney(playerid, -500-high);
				new Float:x;
				new Float:y;
				new Float:z;
				GivePlayerWeapon(playerid, 46, 1);
				GetPlayerPos(playerid, x, y, z);
				SetPlayerPos(playerid, x, y, z+high);
				SendClientMessage(playerid, COLOR_YELLOW, "* YEEAAHHRR!!! :)");
				format(string, sizeof(string), "--- %s (id: %d) skydived by %d.", giveplayer,playerid,high);
				printf(string);
			}
			else
				SendClientMessage(playerid, COLOR_RED, "* Nie masz wystarczających pieniędzy.");
		}
		
		return 1;
	}