Hallo ich habe ein /cuff System gescriptet!
Nun wie mache ich ein /uncuff?
LG
/uncuff?
- PizzaHaus
- Geschlossen
- Erledigt
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Schau dir mal dieses Tutorial an:
http://forum.sa-mp.com/showthread.php?t=371873Das sollte dir auf die Sprünge helfen.
-
Schau dir mal dieses Tutorial an:
http://forum.sa-mp.com/showthread.php?t=371873Das sollte dir auf die Sprünge helfen.
klappt ned bei /uncuff ist man immer noch gefesselt -
Dann poste mal deine beiden Befehle wie sie jetzt sind.
-
Dann poste mal deine beiden Befehle wie sie jetzt sind.
ocmd:uncuff(playerid, params[])
{new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "INFO: You have uncuffed %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "WARNING: You have been uncuffed by %s!",name);
SendClientMessage(targetid, 0xE01B1B, str);
return 1;
}}
return 1;
}ocmd:cuff(playerid,params[])
{
if(sInfo[playerid][fraktion]==1)
{
new pID,string[128],string2[128];
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,COLOR_WHITE,"Benutze: /cuff [ID]");
new Float: x, Float: y, Float: z;
GetPlayerPos(pID,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,5.0,x,y,z))
{
TogglePlayerControllable(pID,0);
format(string,sizeof(string),"Du hast %s gefesselt.",getPlayerName(pID));
format(string2,sizeof(string2),"Du wurdest von %s gefesselt",getPlayerName(playerid));
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(pID,COLOR_WHITE,string2);
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"Du bist zuweit von disem Spieler entfernt");
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"Du gehörst keiner Staatsfraktion (LSPD, SFPD, LVPD) an.");
}
return 1;
} -
So sollte es zu deinem /cuff passen:
ocmd:uncuff(playerid, params[])
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
if(IsPlayerConnected(pID))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(pID, 5.0, x, y, z))
{
SetPlayerSpecialAction(pID,SPECIAL_ACTION_NONE);
TogglePlayerControllable(pID,1);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(pID, target, sizeof(target));
format(str, sizeof(str), "INFO: You have uncuffed %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "WARNING: You have been uncuffed by %s!",name);
SendClientMessage(pID, 0xE01B1B, str);
return 1;
}
}
return 1;
} -
ocmd:uncuff(playerid, params[])
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
if(IsPlayerConnected(pID))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(pID, 5.0, x, y, z))
{
SetPlayerSpecialAction(pID,SPECIAL_ACTION_NONE);
TogglePlayerControllable(pID,1);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(pID, target, sizeof(target));
format(str, sizeof(str), "INFO: You have uncuffed %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "WARNING: You have been uncuffed by %s!",name);
SendClientMessage(pID, 0xE01B1B, str);
return 1;
}
}
return 1;
}Jetzt bekomme ich einen Warning:
ocmd:uncuff(playerid, params[])
{
if(sInfo[playerid][fraktion]==1)
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
if(IsPlayerConnected(pID))
{
SetPlayerSpecialAction(pID,SPECIAL_ACTION_NONE);
TogglePlayerControllable(pID,1);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(pID, target, sizeof(target));
format(str, sizeof(str), "INFO: Du hast %s entcufft!",target);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str, sizeof(str), "WARNING: Du wurdest von %s entcufft!",name);
SendClientMessage(pID, COLOR_WHITE, str);
return 1;
}
}
}C:\Users\xxxx\Desktop\SA-MP Server\gamemodes\kor.pwn(836) : warning 209: function "ocmd_uncuff" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase1 Warning.
-
Würdest du bitte nicht meinen ganzen Post mit allen Codes zitieren? Das macht den Thread sehr unübersichtlich. Danke!
Du hast ein return vergessen:
ocmd:uncuff(playerid, params[])
{
if(sInfo[playerid][fraktion]==1)
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "[USAGE]: /uncuff [Part of Name/Player ID]");
if(IsPlayerConnected(pID))
{
SetPlayerSpecialAction(pID,SPECIAL_ACTION_NONE);
TogglePlayerControllable(pID,1);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(pID, target, sizeof(target));
format(str, sizeof(str), "INFO: Du hast %s entcufft!",target);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str, sizeof(str), "WARNING: Du wurdest von %s entcufft!",name);
SendClientMessage(pID, COLOR_WHITE, str);
return 1;
}
}
return 1; //Das hier.
} -
danke hat sich schon erledigt^^
-
breadfish.de
Hat das Thema geschlossen.