Script Help
#1

Код HTML:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk", true, 4) == 0)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, 24);
	SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
	SetPlayerVirtualWorld(playerid, 1337);
	TogglePlayerControllable(playerid, 0);
	return 1;
}
if(strcmp(cmdtext, "/back", true, 5) == 0)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, 24);
	SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
	SetPlayerVirtualWorld(playerid, 0);
	TogglePlayerControllable(playerid, 1);
	return 1;
}
if(strcmp(cmdtext, "/aa", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
	SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
	GameTextForPlayer(playerid,"Abandon Airport",4000,6);
	return 1;
}
if(strcmp(cmdtext, "/islanddm", true) == 0)
{
    SetPlayerInterior(playerid, 0);
	RemovePlayerFromVehicle(playerid);
	ResetPlayerWeapons(playerid);
	SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
	GivePlayerWeapon(playerid, 22, 5200);
	GivePlayerWeapon(playerid, 27, 1100);
	GivePlayerWeapon(playerid, 31, 4000);
	GameTextForPlayer(playerid,"Island Dm",4000,6);
	return 1;
}
if(strcmp(cmdtext, "/lvairstunt", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
	SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,1066.05,1319.98,247.50);
	GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
	return 1;
}

}
Is there any wrong? if so fix it and reply the right, please!
Reply
#2

Do you get errors or sumthing ?

If yes, Show us error line.
Reply
#3

Код HTML:
C:\Users\mahmoud\Desktop\SAMP Server\pawno\Untitled.pwn(142) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
That's what show me when I pressed to RUN it to the server.
Reply
#4

Use this

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/afk", true, 4) == 0)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, 24);
	SendClientMessage(playerid, 0xFF0000AA, "You have gone AFK..");
	SetPlayerVirtualWorld(playerid, 1337);
	TogglePlayerControllable(playerid, 0);
	return 1;
}
if(strcmp(cmdtext, "/back", true, 5) == 0)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, 24);
	SendClientMessage(playerid, 0xFF0000AA, "You've Back from AFK..");
	SetPlayerVirtualWorld(playerid, 0);
	TogglePlayerControllable(playerid, 1);
	return 1;
}
if(strcmp(cmdtext, "/aa", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1404.1338,2436.8818,16.5000);
	SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, 1404.1338,2436.8818,16.5000);
	GameTextForPlayer(playerid,"Abandon Airport",4000,6);
	return 1;
}
if(strcmp(cmdtext, "/islanddm", true) == 0)
{
    SetPlayerInterior(playerid, 0);
	RemovePlayerFromVehicle(playerid);
	ResetPlayerWeapons(playerid);
	SetPlayerPos(playerid, 1372.8043,-3284.4734,3.1422);
	GivePlayerWeapon(playerid, 22, 5200);
	GivePlayerWeapon(playerid, 27, 1100);
	GivePlayerWeapon(playerid, 31, 4000);
	GameTextForPlayer(playerid,"Island Dm",4000,6);
	return 1;
}
if(strcmp(cmdtext, "/lvairstunt", true) == 0)
{
    SetVehiclePos(GetPlayerVehicleID(playerid), 1066.05,1319.98,247.50);
	SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
	LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,1066.05,1319.98,247.50);
	GameTextForPlayer(playerid,"Use /Carmenu for vehicles!!",4000,6);
	return 1;
}
return 1;
}
Reply
#5

I used yours but there one error left it's

Код HTML:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
If you understand what this error post a reply the right thing, waiting your reply.
Reply
#6

That's not a error, that means everything is ok :P
Reply
#7

That isn't a error.. Script complited witout errors! You can use it now easy...
Reply
#8

You have alot to learn in PAWN.. :P
Reply
#9

Lol, I see
Reply
#10

It's won't work?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)